if_let_some_result: make lint adhere to lint message convention
This commit is contained in:
parent
89591a78b8
commit
605e027fda
@ -61,8 +61,8 @@ impl<'tcx> LateLintPass<'tcx> for OkIfLet {
|
||||
cx,
|
||||
IF_LET_SOME_RESULT,
|
||||
expr.span.with_hi(op.span.hi()),
|
||||
"Matching on `Some` with `ok()` is redundant",
|
||||
&format!("Consider matching on `Ok({})` and removing the call to `ok` instead", some_expr_string),
|
||||
"matching on `Some` with `ok()` is redundant",
|
||||
&format!("consider matching on `Ok({})` and removing the call to `ok` instead", some_expr_string),
|
||||
sugg,
|
||||
applicability,
|
||||
);
|
||||
|
@ -1,22 +1,22 @@
|
||||
error: Matching on `Some` with `ok()` is redundant
|
||||
error: matching on `Some` with `ok()` is redundant
|
||||
--> $DIR/if_let_some_result.rs:6:5
|
||||
|
|
||||
LL | if let Some(y) = x.parse().ok() {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D clippy::if-let-some-result` implied by `-D warnings`
|
||||
help: Consider matching on `Ok(y)` and removing the call to `ok` instead
|
||||
help: consider matching on `Ok(y)` and removing the call to `ok` instead
|
||||
|
|
||||
LL | if let Ok(y) = x.parse() {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: Matching on `Some` with `ok()` is redundant
|
||||
error: matching on `Some` with `ok()` is redundant
|
||||
--> $DIR/if_let_some_result.rs:24:9
|
||||
|
|
||||
LL | if let Some(y) = x . parse() . ok () {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
help: Consider matching on `Ok(y)` and removing the call to `ok` instead
|
||||
help: consider matching on `Ok(y)` and removing the call to `ok` instead
|
||||
|
|
||||
LL | if let Ok(y) = x . parse() {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
Loading…
x
Reference in New Issue
Block a user