Macro as_bytes

Source
macro_rules! as_bytes {
    ( $s:expr $(,)? ) => { ... };
}
Expand description

const-friendly version of as_bytes!.

#[macro_use]
extern crate byte_strings;

const MESSAGE: &str = "Hello, World!";
const MESSAGE_BYTES: &[u8] = const_as_bytes!(MESSAGE);