summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/sugg-else-for-closure.rs
blob: 540ced91fc950690a93efaf6cebc97628c4a5c86 (plain)
1
2
3
4
5
6
7
8
// run-rustfix

fn main() {
    let x = "com.example.app";
    let y: Option<&str> = None;
    let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap());
    //~^ ERROR: mismatched types [E0308]
}