mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 06:28:20 +03:00
a09204ad18
chore: update .fixed. fix: suggestion. Revert irrelevant changes.
19 lines
363 B
Rust
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
|
|
}
|
|
}
|