[−][src]Crate utf16_lit
Provides a proc-macro for making utf-16 literals.
use utf16_lit::utf16_lit; // must be an item! utf16_lit!(EXAMPLE, "example"); fn main() { let v: Vec<u16> = "example".encode_utf16().collect(); assert_eq!(v, EXAMPLE); }
Currently "function-like" proc macros can't be used in expression or statement position, only item position. This means that the ergonomics of this proc-macro are quite poor at the moment. Once the proc-macro situation improves we can make this proc-macro more "natural" to use.
In the future I hope to slim it down so that it's just a string literal to
&[u16]
conversion, without needing to pass in idents to make constants or
any of that.
Macros
utf16_lit | Makes a |