Macro const_bytes

Source
macro_rules! const_bytes {
    ($bytes: expr) => { ... };
}
Expand description

Similar to const_slice!, but constructs Bytes.

§Examples

Simple usage:

use non_empty_slice::const_bytes;

let nekit = const_bytes!(b"nekit");

Compilation failure if the bytes are empty:

use non_empty_slice::const_bytes;

let empty = const_bytes!(b"");