You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+49-1Lines changed: 49 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ assert_eq!("This is just a test text.".as_bytes(), TEST[0]);
41
41
assert_eq!(TEST[1], "Some text...".as_bytes());
42
42
```
43
43
44
-
You should notice that the struct created from `include_bytes` and `include_str` macros isn't equal to `&'static [u8]` or `&'static str`.
44
+
You should notice that the struct created from `lazy_static_include_bytes` and `lazy_static_include_str` macros isn't equal to `&'static [u8]` or `&'static str`.
45
45
If you want to get an exact `&'static [u8]` or `&'static str` reference, you need to **dereference the struct**.
There is a special macro `lazy_static_include_array` which can include arrays from files.
71
+
The array is fixed sized and can be one of these following types: `bool`, `char`, `u8`, `u16`, `u32`, `u64`, `u128`, `i8`, `i16`, `i32`, `i64`, `i128`, `f32`, `f64`, `&'static str`.
72
+
73
+
Also, the `lazy_static_include_array` macro includes data from files into the compiled executable binary file **only** when you are using the **release** profile.
0 commit comments