]> git.lizzy.rs Git - rust.git/commitdiff
address review comments
authorMazdak Farrokhzad <twingoow@gmail.com>
Thu, 19 Dec 2019 09:42:07 +0000 (10:42 +0100)
committerMazdak Farrokhzad <twingoow@gmail.com>
Fri, 20 Dec 2019 21:22:44 +0000 (22:22 +0100)
src/librustc_lint/unused.rs

index e030954b011c3b340708f49f69c09fc229264b2f..06ec3f380091560484f1e91b1732ead11dcbeb5b 100644 (file)
@@ -392,7 +392,7 @@ fn check_unused_parens_pat(
         avoid_or: bool,
         avoid_mut: bool,
     ) {
-        use ast::{PatKind, BindingMode::ByValue, Mutability::Mut};
+        use ast::{PatKind, BindingMode, Mutability};
 
         if let PatKind::Paren(inner) = &value.kind {
             match inner.kind {
@@ -404,7 +404,7 @@ fn check_unused_parens_pat(
                 // Avoid `p0 | .. | pn` if we should.
                 PatKind::Or(..) if avoid_or => return,
                 // Avoid `mut x` and `mut x @ p` if we should:
-                PatKind::Ident(ByValue(Mut), ..) if avoid_mut => return,
+                PatKind::Ident(BindingMode::ByValue(Mutability::Mut), ..) if avoid_mut => return,
                 // Otherwise proceed with linting.
                 _ => {}
             }