Lets you change a standard Rust string literal (utf8) into a utf16 value at compile time.
This crate doesn't use syn
or quote
, so it builds very fast.
Currently, "function-like" proc-macros are not so great in rust. They must only be used in "item position" (at the top level of a module), not in "statement position" (a line of their own within a block of code) or "expression position" (as a sub-portion of an expression within a statement). This makes the current usage of the proc-macro quite poor.
Once function-like proc-macros are available in expression position, the library will be updated so that the usage produces an expression. This will be a completely breaking change.
```rust // Currently the usage is like this: utf16_lit!(EXAMPLE, "example");
// our goal usage is something like this pub const EXAMPLE: &[u16] = utf16_lit!("example");
// and also things like this should be possible fn isfoo(input: &[u16]) -> bool { input == utf16lit!("foo") } ```
Tracking Issues of Note:
* Tracking issue for procedural macros and "hygiene 2.0"
* Stabilize fn-like proc macros in expression, pattern and statement positions
* Stabilize Span::mixed_site