macro_rules! slice { ($($el:expr),+ $(,)?) => { ... }; }
Expand description
Create a non-empty slice
const SLICE: &NonEmpty<[&str]> = slice!["hello", "world"];
Note that no slice_mut
is provided1 - users are expected to use array!
and Array::as_mut_slice
as required.
See this blog post for more on why
slice_mut
is impossible to implement in Rust today. ↩