rust/tests/ui/manual_map_option_2.stderr
Jason Newcomb 4838c78ba4
Improve manual_map and map_entry
Locals which can be partially moved created within the to-be-created closure shouldn't block the use of a closure
2021-08-14 19:49:45 -04:00

25 lines
606 B
Plaintext

error: manual implementation of `Option::map`
--> $DIR/manual_map_option_2.rs:6:13
|
LL | let _ = match Some(0) {
| _____________^
LL | | Some(x) => Some({
LL | | let y = (String::new(), String::new());
LL | | (x, y.0)
LL | | }),
LL | | None => None,
LL | | };
| |_____^
|
= note: `-D clippy::manual-map` implied by `-D warnings`
help: try this
|
LL | let _ = Some(0).map(|x| {
LL | let y = (String::new(), String::new());
LL | (x, y.0)
LL | });
|
error: aborting due to previous error