macro_rules! const_sv {
($str:expr) => { ... };
}
Expand description
Constructs a StringView
in a constant context.
This is equivalent to StringView::new(str)
, except it is valid in a const initializer
must be called with a string literal or a constant expression of type &'static str
Examples
const HELLO_WORLD: StringView = const_sv!("Hello World");
assert_eq!(HELLO_WORLD,StringView::new("Hello World"));