Skip to content

Commit

Permalink
suspicious-arithmetic-impl: make lint adhere to lint message convention
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Aug 10, 2020
1 parent 7954c22 commit fe37ddb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/suspicious_trait_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl<'tcx> LateLintPass<'tcx> for SuspiciousImpl {
cx,
SUSPICIOUS_ARITHMETIC_IMPL,
binop.span,
&format!(r#"Suspicious use of binary operator in `{}` impl"#, impl_trait),
&format!("suspicious use of binary operator in `{}` impl", impl_trait),
);
}

Expand Down Expand Up @@ -135,7 +135,7 @@ impl<'tcx> LateLintPass<'tcx> for SuspiciousImpl {
cx,
SUSPICIOUS_OP_ASSIGN_IMPL,
binop.span,
&format!(r#"Suspicious use of binary operator in `{}` impl"#, impl_trait),
&format!("suspicious use of binary operator in `{}` impl", impl_trait),
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/suspicious_arithmetic_impl.stderr
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
error: Suspicious use of binary operator in `Add` impl
error: suspicious use of binary operator in `Add` impl
--> $DIR/suspicious_arithmetic_impl.rs:11:20
|
LL | Foo(self.0 - other.0)
| ^
|
= note: `-D clippy::suspicious-arithmetic-impl` implied by `-D warnings`

error: Suspicious use of binary operator in `AddAssign` impl
error: suspicious use of binary operator in `AddAssign` impl
--> $DIR/suspicious_arithmetic_impl.rs:17:23
|
LL | *self = *self - other;
| ^
|
= note: `#[deny(clippy::suspicious_op_assign_impl)]` on by default

error: Suspicious use of binary operator in `MulAssign` impl
error: suspicious use of binary operator in `MulAssign` impl
--> $DIR/suspicious_arithmetic_impl.rs:30:16
|
LL | self.0 /= other.0;
Expand Down

0 comments on commit fe37ddb

Please sign in to comment.