]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/clippy/tests/ui/map_unwrap_or_fixable.stderr
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / map_unwrap_or_fixable.stderr
diff --git a/src/tools/clippy/tests/ui/map_unwrap_or_fixable.stderr b/src/tools/clippy/tests/ui/map_unwrap_or_fixable.stderr
new file mode 100644 (file)
index 0000000..1837bc2
--- /dev/null
@@ -0,0 +1,22 @@
+error: called `map(<f>).unwrap_or_else(<g>)` on an `Option` value. This can be done more directly by calling `map_or_else(<g>, <f>)` instead
+  --> $DIR/map_unwrap_or_fixable.rs:17:13
+   |
+LL |       let _ = opt.map(|x| x + 1)
+   |  _____________^
+LL | |         // Should lint even though this call is on a separate line.
+LL | |         .unwrap_or_else(|| 0);
+   | |_____________________________^ help: try this: `opt.map_or_else(|| 0, |x| x + 1)`
+   |
+   = note: `-D clippy::map-unwrap-or` implied by `-D warnings`
+
+error: called `map(<f>).unwrap_or_else(<g>)` on a `Result` value. This can be done more directly by calling `.map_or_else(<g>, <f>)` instead
+  --> $DIR/map_unwrap_or_fixable.rs:47:13
+   |
+LL |       let _ = res.map(|x| x + 1)
+   |  _____________^
+LL | |         // should lint even though this call is on a separate line
+LL | |         .unwrap_or_else(|_e| 0);
+   | |_______________________________^ help: try this: `res.map_or_else(|_e| 0, |x| x + 1)`
+
+error: aborting due to 2 previous errors
+