Crates.io | wstr |
lib.rs | wstr |
version | 0.2.0 |
source | src |
created_at | 2017-03-07 16:11:12.462098 |
updated_at | 2017-10-31 14:11:37.038675 |
description | Macros for compile-time UTF-16 (wide) string literals. |
homepage | |
repository | https://github.com/nitric1/wstr-rs |
max_upload_size | |
id | 8882 |
size | 4,836 |
Rust macros for compile-time UTF-16 (wide) string literals.
Add this in your Cargo.toml
dependencies:
wstr = "0.2"
Then add this in your crate root:
#[macro_use]
extern crate wstr;
If you need widestr!
macro (for the WideStr
string), also add a dependency to widestring
crate and use widestring
feature.
Now you are ready to use wstr!
, wstrz!
, and widestr!
macro.
let wstr = wstr!("Hello, world! \u{1F601}"); // &'static [u16], not null-terminated
let wstrz = wstrz!("Null-terminated, without specifying \\0. \u{B110}"); // &'static [u16], null-terminated
extern crate widestring;
let widestr = widestr!("麻雀/麻将 \u{1F007}\u{1F010}\u{1F019}"); // &'static widestring::WideStr