diff --git a/clippy_lints/src/methods/unnecessary_join.rs b/clippy_lints/src/methods/unnecessary_join.rs index 973b8a7e6..33efa16c3 100644 --- a/clippy_lints/src/methods/unnecessary_join.rs +++ b/clippy_lints/src/methods/unnecessary_join.rs @@ -31,7 +31,7 @@ pub(super) fn check<'tcx>( cx, UNNECESSARY_JOIN, span.with_hi(expr.span.hi()), - r#"called `.collect>().join("")` on an iterator"#, + r#"called `.collect::>().join("")` on an iterator"#, "try using", "collect::()".to_owned(), applicability, diff --git a/tests/ui/unnecessary_join.stderr b/tests/ui/unnecessary_join.stderr index 0b14b143a..e919a6d1d 100644 --- a/tests/ui/unnecessary_join.stderr +++ b/tests/ui/unnecessary_join.stderr @@ -1,4 +1,4 @@ -error: called `.collect>().join("")` on an iterator +error: called `.collect::>().join("")` on an iterator --> $DIR/unnecessary_join.rs:11:10 | LL | .collect::>() @@ -8,7 +8,7 @@ LL | | .join(""); | = note: `-D clippy::unnecessary-join` implied by `-D warnings` -error: called `.collect>().join("")` on an iterator +error: called `.collect::>().join("")` on an iterator --> $DIR/unnecessary_join.rs:20:10 | LL | .collect::>()