Skip to content

Commit

Permalink
if_not_else: make lint adhere to lint message convention
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Aug 11, 2020
1 parent 605e027 commit be3e695
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/if_not_else.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl EarlyLintPass for IfNotElse {
cx,
IF_NOT_ELSE,
item.span,
"Unnecessary boolean `not` operation",
"unnecessary boolean `not` operation",
None,
"remove the `!` and swap the blocks of the `if`/`else`",
);
Expand All @@ -70,7 +70,7 @@ impl EarlyLintPass for IfNotElse {
cx,
IF_NOT_ELSE,
item.span,
"Unnecessary `!=` operation",
"unnecessary `!=` operation",
None,
"change to `==` and swap the blocks of the `if`/`else`",
);
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/use_self.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ declare_clippy_lint! {
/// ```
pub USE_SELF,
nursery,
"Unnecessary structure name repetition whereas `Self` is applicable"
"unnecessary structure name repetition whereas `Self` is applicable"
}

declare_lint_pass!(UseSelf => [USE_SELF]);
Expand Down
2 changes: 1 addition & 1 deletion src/lintlist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2498,7 +2498,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
Lint {
name: "use_self",
group: "nursery",
desc: "Unnecessary structure name repetition whereas `Self` is applicable",
desc: "unnecessary structure name repetition whereas `Self` is applicable",
deprecation: None,
module: "use_self",
},
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/if_not_else.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: Unnecessary boolean `not` operation
error: unnecessary boolean `not` operation
--> $DIR/if_not_else.rs:9:5
|
LL | / if !bla() {
Expand All @@ -11,7 +11,7 @@ LL | | }
= note: `-D clippy::if-not-else` implied by `-D warnings`
= help: remove the `!` and swap the blocks of the `if`/`else`

error: Unnecessary `!=` operation
error: unnecessary `!=` operation
--> $DIR/if_not_else.rs:14:5
|
LL | / if 4 != 5 {
Expand Down

0 comments on commit be3e695

Please sign in to comment.