| //@ 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 | |
| } | |
| } |