Macro concat_bytes
macro_rules! concat_bytes {
($($x: expr),+ $(,)?) => { ... };
}
Available on crate feature
dep_const_str
only.Expand description
Concatenates values into a byte slice.
The input type must be one of
The output type is &[u8; _]
.
ยงExamples
const S1: &[u8; 7] = const_str::concat_bytes!(b'A', b"BC", [68, b'E', 70], "G");
const S2: &[u8] = const_str::concat_bytes!(S1, "/123", 0u8);
assert_eq!(S1, b"ABCDEFG");
assert_eq!(S2, b"ABCDEFG/123\x00");