Closed
Description
When given
fn d(opt_str: Option<String>) {
let s = if let Some(s) = opt_str {
//~^ ERROR mismatched types
} else {
String::new()
};
}
we should mention that s
might be missing in the if
branch of the expression, like we do for
fn d(opt_str: Option<String>) {
let s: String = if let Some(s) = opt_str {
//~^ ERROR mismatched types
} else {
String::new()
};
}