]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/let_if_seq.rs
Auto merge of #3985 - phansch:move_some_cast_tests, r=flip1995
[rust.git] / clippy_lints / src / let_if_seq.rs
index 1f454c4983a96c936bf6015ade6dd9b551fd8280..f5da2d7803e381254daaaa079093fc6bb77eaafc 100644 (file)
@@ -4,7 +4,7 @@
 use rustc::hir::def::Def;
 use rustc::hir::BindingAnnotation;
 use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
-use rustc::{declare_tool_lint, lint_array};
+use rustc::{declare_lint_pass, declare_tool_lint};
 use rustc_errors::Applicability;
 
 declare_clippy_lint! {
     "unidiomatic `let mut` declaration followed by initialization in `if`"
 }
 
-#[derive(Copy, Clone)]
-pub struct LetIfSeq;
-
-impl LintPass for LetIfSeq {
-    fn get_lints(&self) -> LintArray {
-        lint_array!(USELESS_LET_IF_SEQ)
-    }
-
-    fn name(&self) -> &'static str {
-        "LetIfSeq"
-    }
-}
+declare_lint_pass!(LetIfSeq => [USELESS_LET_IF_SEQ]);
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LetIfSeq {
     fn check_block(&mut self, cx: &LateContext<'a, 'tcx>, block: &'tcx hir::Block) {