summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/option_map_or_err_ok.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/option_map_or_err_ok.fixed')
-rw-r--r--src/tools/clippy/tests/ui/option_map_or_err_ok.fixed7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/option_map_or_err_ok.fixed b/src/tools/clippy/tests/ui/option_map_or_err_ok.fixed
new file mode 100644
index 000000000..131f4b209
--- /dev/null
+++ b/src/tools/clippy/tests/ui/option_map_or_err_ok.fixed
@@ -0,0 +1,7 @@
+#![warn(clippy::option_map_or_err_ok)]
+
+fn main() {
+ let x = Some("a");
+ let _ = x.ok_or("a");
+ //~^ ERROR: called `map_or(Err(_), Ok)` on an `Option` value
+}