blob: 620c35fb270cc0f98b6917d75a0f4293c8a6de66 [file] [edit]
//@ 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
}
}