Files
rust/tests/ui/pattern/string-match-as-str-suggestion.fixed
T
Kokoro2336 a09204ad18 fix: missing suggestion for string match.
chore: update .fixed.

fix: suggestion.

Revert irrelevant changes.
2026-05-26 02:01:52 +08:00

19 lines
363 B
Rust

//@ run-rustfix
fn main() {
let s = "yes".to_owned();
let _ = match s.as_str() {
"yes" => Some(true),
//~^ ERROR mismatched types
"no" => Some(false),
//~^ ERROR mismatched types
_ => None,
};
let s2 = String::from("hello");
if let "hello" = s2.as_str() {
//~^ ERROR mismatched types
}
}