On Rust Nightly, I got the following pattern match to work:
const FOO: TinyStr16 = tinystr16!("foo");
const BAR: TinyStr16 = tinystr16!("bar");
match tinystr_input {
FOO => /* ... */,
BAR => /* ... */,
_ => /* ... */,
}
This is fine, but it would be nicer if I could write
match tinystr_input {
tinystr16!("foo") => /* ... */,
tinystr16!("bar") => /* ... */,
_ => /* ... */,
}
Unfortunately, this doesn't seem to work right now.
Is the first example the best way to do pattern matching on TinyStr, or is there a better way?
On Rust Nightly, I got the following pattern match to work:
This is fine, but it would be nicer if I could write
Unfortunately, this doesn't seem to work right now.
Is the first example the best way to do pattern matching on TinyStr, or is there a better way?