2022-09-28 16:52:48 -05:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/sugg-else-for-closure.rs:6:26
|
|
|
|
|
|
|
|
|
LL | let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap());
|
|
|
|
| --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&str`, found closure
|
|
|
|
| |
|
2023-01-04 21:02:10 -06:00
|
|
|
| arguments to this method are incorrect
|
2022-09-28 16:52:48 -05:00
|
|
|
|
|
|
|
|
= note: expected reference `&str`
|
2023-09-09 01:36:50 -05:00
|
|
|
found closure `{closure@$DIR/sugg-else-for-closure.rs:6:26: 6:28}`
|
|
|
|
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
|
2023-01-08 06:10:48 -06:00
|
|
|
--> $DIR/sugg-else-for-closure.rs:6:14
|
|
|
|
|
|
|
|
|
LL | let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap());
|
|
|
|
| ^^^^^^^^^^^^-------------------------------^
|
|
|
|
| |
|
|
|
|
| this argument influences the return type of `unwrap_or`
|
2023-02-21 15:11:08 -06:00
|
|
|
note: method defined here
|
2022-09-28 16:52:48 -05:00
|
|
|
--> $SRC_DIR/core/src/option.rs:LL:COL
|
|
|
|
help: try calling `unwrap_or_else` instead
|
|
|
|
|
|
|
|
|
LL | let _s = y.unwrap_or_else(|| x.split('.').nth(1).unwrap());
|
|
|
|
| +++++
|
|
|
|
|
2023-11-21 09:44:16 -06:00
|
|
|
error: aborting due to 1 previous error
|
2022-09-28 16:52:48 -05:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|