match_domstring_ascii

Macro match_domstring_ascii 

Source
macro_rules! match_domstring_ascii {
    ($input:expr, $($tail:tt)*) => { ... };
}
Expand description

Use this to match &str against lazydomstring efficiently. You are only allowed to match ascii strings otherwise this macro will lead to wrong results.

let s = DOMString::from_string(String::from("test"));
let value = match_domstring!(s,
"test1" => 1,
"test2" => 2,
"test" => 3,
_ => 4,
);
assert_eq!(value, 3);