diff --git a/README.md b/README.md index 1232f5268..8c00c9f90 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ fn main(){ Produce this warning: ``` -src/main.rs:8:5: 11:6 warning: You seem to be trying to use match for destructuring a single type. Did you mean to use `if let`?, #[warn(single_match)] on by default +src/main.rs:8:5: 11:6 warning: you seem to be trying to use match for destructuring a single type. Consider using `if let`, #[warn(single_match)] on by default src/main.rs:8 match x { src/main.rs:9 Some(y) => println!("{:?}", y), src/main.rs:10 _ => () diff --git a/src/matches.rs b/src/matches.rs index 3d04c9210..fdc3ca5e9 100644 --- a/src/matches.rs +++ b/src/matches.rs @@ -37,13 +37,12 @@ impl LintPass for MatchPass { { if in_external_macro(cx, expr.span) {return;} span_help_and_lint(cx, SINGLE_MATCH, expr.span, - "you seem to be trying to use match for \ - destructuring a single pattern. Did you mean to \ - use `if let`?", - &format!("try\nif let {} = {} {}", - snippet(cx, arms[0].pats[0].span, ".."), - snippet(cx, ex.span, ".."), - expr_block(cx, &arms[0].body, ".."))); + "you seem to be trying to use match for destructuring a \ + single pattern. Consider using `if let`", + &format!("try\nif let {} = {} {}", + snippet(cx, arms[0].pats[0].span, ".."), + snippet(cx, ex.span, ".."), + expr_block(cx, &arms[0].body, ".."))); } // check preconditions for MATCH_REF_PATS diff --git a/src/types.rs b/src/types.rs index 3c4d1441f..4a3c18346 100644 --- a/src/types.rs +++ b/src/types.rs @@ -30,7 +30,7 @@ impl LintPass for TypePass { if match_type(cx, inner, &VEC_PATH) { span_help_and_lint( cx, BOX_VEC, ast_ty.span, - "you seem to be trying to use `Box>`. Did you mean to use `Vec`?", + "you seem to be trying to use `Box>`. Consider using just `Vec`", "`Vec` is already on the heap, `Box>` makes an extra allocation."); } }