Macro widestring::u16str

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

Converts a string literal into a const UTF-16 string slice of type U16Str.

The resulting const string slice will always be valid UTF-16.

§Examples

use widestring::{u16str, U16Str, U16String};

const STRING: &U16Str = u16str!("My string");
assert_eq!(U16String::from_str("My string"), STRING);