Skip to content

Commit

Permalink
Fix some more stutter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
devonhollowood committed Oct 13, 2018
1 parent 73ba33d commit 335bc1e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
9 changes: 4 additions & 5 deletions clippy_lints/src/double_comparison.rs
Expand Up @@ -40,16 +40,15 @@ declare_clippy_lint! {
"unnecessary double comparisons that can be simplified"
}

#[allow(clippy::stutter)]
pub struct DoubleComparisonPass;
pub struct Pass;

impl LintPass for DoubleComparisonPass {
impl LintPass for Pass {
fn get_lints(&self) -> LintArray {
lint_array!(DOUBLE_COMPARISONS)
}
}

impl<'a, 'tcx> DoubleComparisonPass {
impl<'a, 'tcx> Pass {
#[allow(clippy::similar_names)]
fn check_binop(
&self,
Expand Down Expand Up @@ -89,7 +88,7 @@ impl<'a, 'tcx> DoubleComparisonPass {
}
}

impl<'a, 'tcx> LateLintPass<'a, 'tcx> for DoubleComparisonPass {
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
if let ExprKind::Binary(ref kind, ref lhs, ref rhs) = expr.node {
self.check_binop(cx, kind.node, lhs, rhs, expr.span);
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/lib.rs
Expand Up @@ -428,8 +428,8 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
reg.register_late_lint_pass(box fallible_impl_from::FallibleImplFrom);
reg.register_late_lint_pass(box replace_consts::ReplaceConsts);
reg.register_late_lint_pass(box types::UnitArg);
reg.register_late_lint_pass(box double_comparison::DoubleComparisonPass);
reg.register_late_lint_pass(box question_mark::QuestionMarkPass);
reg.register_late_lint_pass(box double_comparison::Pass);
reg.register_late_lint_pass(box question_mark::Pass);
reg.register_late_lint_pass(box suspicious_trait_impl::SuspiciousImpl);
reg.register_early_lint_pass(box multiple_crate_versions::Pass);
reg.register_late_lint_pass(box map_unit_fn::Pass);
Expand Down
9 changes: 4 additions & 5 deletions clippy_lints/src/question_mark.rs
Expand Up @@ -44,17 +44,16 @@ declare_clippy_lint!{
"checks for expressions that could be replaced by the question mark operator"
}

#[allow(clippy::stutter)]
#[derive(Copy, Clone)]
pub struct QuestionMarkPass;
pub struct Pass;

impl LintPass for QuestionMarkPass {
impl LintPass for Pass {
fn get_lints(&self) -> LintArray {
lint_array!(QUESTION_MARK)
}
}

impl QuestionMarkPass {
impl Pass {
/// Check if the given expression on the given context matches the following structure:
///
/// ```ignore
Expand Down Expand Up @@ -146,7 +145,7 @@ impl QuestionMarkPass {
}
}

impl<'a, 'tcx> LateLintPass<'a, 'tcx> for QuestionMarkPass {
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
Self::check_is_none_and_early_return_none(cx, expr);
}
Expand Down

0 comments on commit 335bc1e

Please sign in to comment.