Macro andiskaz::tstring[][src]

macro_rules! tstring {
    [] => { ... };
    [$s : expr $(,) ?] => { ... };
    ($fmt : expr, $fst : expr $(, $rest : expr) * $(,) ?) => { ... };
}
Expand description

Creates a TermString from string literal. Currently, invalid string get the unicode replacement character in their invalid characters. However, implementation may change to panic in those cases.

Example

use andiskaz::tstring;
use andiskaz::string::TermString;

// A string with many grapheme clusters and unicode special codepoints.
let this_winter = tstring!["ðɪs wɪ̃ɾ̃ɚ"];

assert_eq!(this_winter, TermString::new("ðɪs wɪ̃ɾ̃ɚ").unwrap());
assert_eq!(this_winter.as_str(), "ðɪs wɪ̃ɾ̃ɚ");