Skip to content

Commit 605e027

Browse files
committed
if_let_some_result: make lint adhere to lint message convention
1 parent 89591a7 commit 605e027

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

clippy_lints/src/if_let_some_result.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ impl<'tcx> LateLintPass<'tcx> for OkIfLet {
6161
cx,
6262
IF_LET_SOME_RESULT,
6363
expr.span.with_hi(op.span.hi()),
64-
"Matching on `Some` with `ok()` is redundant",
65-
&format!("Consider matching on `Ok({})` and removing the call to `ok` instead", some_expr_string),
64+
"matching on `Some` with `ok()` is redundant",
65+
&format!("consider matching on `Ok({})` and removing the call to `ok` instead", some_expr_string),
6666
sugg,
6767
applicability,
6868
);

tests/ui/if_let_some_result.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
error: Matching on `Some` with `ok()` is redundant
1+
error: matching on `Some` with `ok()` is redundant
22
--> $DIR/if_let_some_result.rs:6:5
33
|
44
LL | if let Some(y) = x.parse().ok() {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::if-let-some-result` implied by `-D warnings`
8-
help: Consider matching on `Ok(y)` and removing the call to `ok` instead
8+
help: consider matching on `Ok(y)` and removing the call to `ok` instead
99
|
1010
LL | if let Ok(y) = x.parse() {
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^
1212

13-
error: Matching on `Some` with `ok()` is redundant
13+
error: matching on `Some` with `ok()` is redundant
1414
--> $DIR/if_let_some_result.rs:24:9
1515
|
1616
LL | if let Some(y) = x . parse() . ok () {
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1818
|
19-
help: Consider matching on `Ok(y)` and removing the call to `ok` instead
19+
help: consider matching on `Ok(y)` and removing the call to `ok` instead
2020
|
2121
LL | if let Ok(y) = x . parse() {
2222
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)