@@ -2138,7 +2138,7 @@ fn lint_iter_nth<'a, 'tcx>(
2138
2138
ITER_NTH ,
2139
2139
expr. span ,
2140
2140
& format ! ( "called `.iter{0}().nth()` on a {1}" , mut_str, caller_type) ,
2141
- & format ! ( "Calling `.get{}()` is both faster and more readable" , mut_str) ,
2141
+ & format ! ( "calling `.get{}()` is both faster and more readable" , mut_str) ,
2142
2142
) ;
2143
2143
}
2144
2144
@@ -2247,7 +2247,7 @@ fn lint_iter_skip_next(cx: &LateContext<'_, '_>, expr: &hir::Expr<'_>) {
2247
2247
ITER_SKIP_NEXT ,
2248
2248
expr. span ,
2249
2249
"called `skip(x).next()` on an iterator" ,
2250
- "This is more succinctly expressed by calling `nth(x)`. " ,
2250
+ "this is more succinctly expressed by calling `nth(x)`" ,
2251
2251
) ;
2252
2252
}
2253
2253
}
@@ -2309,8 +2309,8 @@ fn lint_unwrap(cx: &LateContext<'_, '_>, expr: &hir::Expr<'_>, unwrap_args: &[hi
2309
2309
expr. span ,
2310
2310
& format ! ( "used `unwrap()` on `{}` value" , kind, ) ,
2311
2311
& format ! (
2312
- "If you don't want to handle the `{}` case gracefully, consider \
2313
- using `expect()` to provide a better panic message. ",
2312
+ "if you don't want to handle the `{}` case gracefully, consider \
2313
+ using `expect()` to provide a better panic message",
2314
2314
none_value,
2315
2315
) ,
2316
2316
) ;
@@ -2335,7 +2335,7 @@ fn lint_expect(cx: &LateContext<'_, '_>, expr: &hir::Expr<'_>, expect_args: &[hi
2335
2335
lint,
2336
2336
expr. span ,
2337
2337
& format ! ( "used `expect()` on `{}` value" , kind, ) ,
2338
- & format ! ( "If this value is an `{}`, it will panic. " , none_value, ) ,
2338
+ & format ! ( "if this value is an `{}`, it will panic" , none_value, ) ,
2339
2339
) ;
2340
2340
}
2341
2341
}
@@ -2355,7 +2355,7 @@ fn lint_ok_expect(cx: &LateContext<'_, '_>, expr: &hir::Expr<'_>, ok_args: &[hir
2355
2355
OK_EXPECT ,
2356
2356
expr. span,
2357
2357
"called `ok().expect()` on a `Result` value" ,
2358
- "You can call `expect()` directly on the `Result`" ,
2358
+ "you can call `expect()` directly on the `Result`" ,
2359
2359
) ;
2360
2360
}
2361
2361
}
@@ -2608,7 +2608,7 @@ fn lint_filter_map<'a, 'tcx>(
2608
2608
// lint if caller of `.filter().map()` is an Iterator
2609
2609
if match_trait_method ( cx, expr, & paths:: ITERATOR ) {
2610
2610
let msg = "called `filter(p).map(q)` on an `Iterator`" ;
2611
- let hint = "This is more succinctly expressed by calling `.filter_map(..)` instead. " ;
2611
+ let hint = "this is more succinctly expressed by calling `.filter_map(..)` instead" ;
2612
2612
span_help_and_lint ( cx, FILTER_MAP , expr. span , msg, hint) ;
2613
2613
}
2614
2614
}
@@ -2648,7 +2648,7 @@ fn lint_find_map<'a, 'tcx>(
2648
2648
// lint if caller of `.filter().map()` is an Iterator
2649
2649
if match_trait_method ( cx, & map_args[ 0 ] , & paths:: ITERATOR ) {
2650
2650
let msg = "called `find(p).map(q)` on an `Iterator`" ;
2651
- let hint = "This is more succinctly expressed by calling `.find_map(..)` instead. " ;
2651
+ let hint = "this is more succinctly expressed by calling `.find_map(..)` instead" ;
2652
2652
span_help_and_lint ( cx, FIND_MAP , expr. span , msg, hint) ;
2653
2653
}
2654
2654
}
@@ -2663,7 +2663,7 @@ fn lint_filter_map_map<'a, 'tcx>(
2663
2663
// lint if caller of `.filter().map()` is an Iterator
2664
2664
if match_trait_method ( cx, expr, & paths:: ITERATOR ) {
2665
2665
let msg = "called `filter_map(p).map(q)` on an `Iterator`" ;
2666
- let hint = "This is more succinctly expressed by only calling `.filter_map(..)` instead. " ;
2666
+ let hint = "this is more succinctly expressed by only calling `.filter_map(..)` instead" ;
2667
2667
span_help_and_lint ( cx, FILTER_MAP , expr. span , msg, hint) ;
2668
2668
}
2669
2669
}
@@ -2678,8 +2678,8 @@ fn lint_filter_flat_map<'a, 'tcx>(
2678
2678
// lint if caller of `.filter().flat_map()` is an Iterator
2679
2679
if match_trait_method ( cx, expr, & paths:: ITERATOR ) {
2680
2680
let msg = "called `filter(p).flat_map(q)` on an `Iterator`" ;
2681
- let hint = "This is more succinctly expressed by calling `.flat_map(..)` \
2682
- and filtering by returning an empty Iterator. ";
2681
+ let hint = "this is more succinctly expressed by calling `.flat_map(..)` \
2682
+ and filtering by returning `iter:: empty()` ";
2683
2683
span_help_and_lint ( cx, FILTER_MAP , expr. span , msg, hint) ;
2684
2684
}
2685
2685
}
@@ -2694,8 +2694,8 @@ fn lint_filter_map_flat_map<'a, 'tcx>(
2694
2694
// lint if caller of `.filter_map().flat_map()` is an Iterator
2695
2695
if match_trait_method ( cx, expr, & paths:: ITERATOR ) {
2696
2696
let msg = "called `filter_map(p).flat_map(q)` on an `Iterator`" ;
2697
- let hint = "This is more succinctly expressed by calling `.flat_map(..)` \
2698
- and filtering by returning an empty Iterator. ";
2697
+ let hint = "this is more succinctly expressed by calling `.flat_map(..)` \
2698
+ and filtering by returning `iter:: empty()` ";
2699
2699
span_help_and_lint ( cx, FILTER_MAP , expr. span , msg, hint) ;
2700
2700
}
2701
2701
}
0 commit comments