Skip to content

Commit

Permalink
Polished lint and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pmk21 committed Apr 18, 2020
1 parent 4d03b4d commit 1c11035
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/ui/implicit_saturating_sub.fixed
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-rustfix
#![allow(unused_assignments, unused_mut)]
#![allow(unused_assignments, unused_mut, clippy::assign_op_pattern)]
#![warn(clippy::implicit_saturating_sub)]

fn main() {
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/implicit_saturating_sub.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// run-rustfix
#![allow(unused_assignments, unused_mut)]
#![allow(unused_assignments, unused_mut, clippy::assign_op_pattern)]
#![warn(clippy::implicit_saturating_sub)]

fn main() {
Expand All @@ -11,7 +11,7 @@ fn main() {

// Lint
if u_8 > 0 {
u_8 -= 1;
u_8 = u_8 - 1;
}

match end_8 {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/implicit_saturating_sub.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error: Implicitly performing saturating subtraction
--> $DIR/implicit_saturating_sub.rs:13:5
|
LL | / if u_8 > 0 {
LL | | u_8 -= 1;
LL | | u_8 = u_8 - 1;
LL | | }
| |_____^ help: try: `u_8 = u_8.saturating_sub(1);`
|
Expand Down

0 comments on commit 1c11035

Please sign in to comment.