Macro hex_lit::hex_static
source · [−]macro_rules! hex_static {
($name:ident = $hex:expr) => { ... };
}
Available on crate feature
rust_v_1_46
only.Expand description
Creates a static byte array of given name.
This is a convenience macro so that you don’t have to write out the type. However it is intentionally not public - public statics must be explicitly typed to avoid accidental change of the type.
Example
use hex_lit::hex_static;
// same as writing `static FOO: [u8; 2] = [0x00, 0xff];`
hex_static!(FOO = "00ff");
assert_eq!(FOO, [0, 255]);