pub const fn concat_strs<'a, Strs: Const<Type = &'a [&'a str]>>() -> &'static str
Expand description
Concats a collection of &str
s into a single &'static str
at compile time.
ยงExample
use const_util::{Const, concat::concat_strs};
struct MyStrings;
impl Const for MyStrings {
type Type = &'static [&'static str];
const VALUE: Self::Type = &[
"Odd",
"Even",
"Schmeven",
];
}
assert_eq!(
concat_strs::<MyStrings>(),
"OddEvenSchmeven",
)