summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/option_if_let_else.fixed
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tools/clippy/tests/ui/option_if_let_else.fixed9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/option_if_let_else.fixed b/src/tools/clippy/tests/ui/option_if_let_else.fixed
index f15ac551b..0456005dc 100644
--- a/src/tools/clippy/tests/ui/option_if_let_else.fixed
+++ b/src/tools/clippy/tests/ui/option_if_let_else.fixed
@@ -189,3 +189,12 @@ fn main() {
let _ = res.map_or(1, |a| a + 1);
let _ = res.map_or(5, |a| a + 1);
}
+
+#[allow(dead_code)]
+fn issue9742() -> Option<&'static str> {
+ // should not lint because of guards
+ match Some("foo ") {
+ Some(name) if name.starts_with("foo") => Some(name.trim()),
+ _ => None,
+ }
+}