Macro const_str::sorted

source ·
macro_rules! sorted {
    ($s:expr) => { ... };
}
Expand description

Sorts string slices and returns a new array.

The input type must be one of:

§Examples

const SORTED1: &[&str] = &const_str::sorted!(["one", "two", "three"]);
assert_eq!(SORTED1, &["one", "three", "two"]);

const SORTED2: [&str; 3] = const_str::sorted!(["1", "2", "10"]);
assert_eq!(SORTED2, ["1", "10", "2"]);