]> git.lizzy.rs Git - rust.git/commitdiff
Avoid triggering match_wildcard_for_single_variants
authorEduardo Broto <ebroto@tutanota.com>
Thu, 21 May 2020 12:47:13 +0000 (14:47 +0200)
committerEduardo Broto <ebroto@tutanota.com>
Thu, 21 May 2020 12:47:13 +0000 (14:47 +0200)
clippy_dev/src/new_lint.rs

index 80713ab569fd584184c555f438785999ba761008..08a2e0c0918f0372de6f8918e1fea5b95cd8839c 100644 (file)
@@ -18,11 +18,11 @@ trait Context {
 impl<T> Context for io::Result<T> {
     fn context<C: AsRef<str>>(self, text: C) -> Self {
         match self {
+            Ok(t) => Ok(t),
             Err(e) => {
                 let message = format!("{}: {}", text.as_ref(), e);
                 Err(io::Error::new(ErrorKind::Other, message))
             },
-            ok => ok,
         }
     }
 }