1 error[E0308]: mismatched types
2 --> $DIR/sugg-else-for-closure.rs:6:26
4 LL | let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap());
5 | --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&str`, found closure
7 | arguments to this method are incorrect
9 = note: expected reference `&str`
10 found closure `[closure@$DIR/sugg-else-for-closure.rs:6:26: 6:28]`
11 help: the return type of this call is `[closure@$DIR/sugg-else-for-closure.rs:6:26: 6:28]` due to the type of the argument passed
12 --> $DIR/sugg-else-for-closure.rs:6:14
14 LL | let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap());
15 | ^^^^^^^^^^^^-------------------------------^
17 | this argument influences the return type of `unwrap_or`
18 note: associated function defined here
19 --> $SRC_DIR/core/src/option.rs:LL:COL
20 help: try calling `unwrap_or_else` instead
22 LL | let _s = y.unwrap_or_else(|| x.split('.').nth(1).unwrap());
25 error: aborting due to previous error
27 For more information about this error, try `rustc --explain E0308`.