Skip to content

Commit ee253ad

Browse files
committed
rewrite a message in the suggestion
1 parent 9ecc1b8 commit ee253ad

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clippy_lints/src/default_instead_of_iter_empty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl<'tcx> LateLintPass<'tcx> for DefaultIterEmpty {
4545
cx,
4646
DEFAULT_INSTEAD_OF_ITER_EMPTY,
4747
expr.span,
48-
"`std::iter::empty()` is shorter than `std::iter::Empty::default()` and same functionality",
48+
"`std::iter::empty()` is the more idiomatic way",
4949
"try",
5050
sugg,
5151
applicability,

tests/ui/default_instead_of_iter_empty.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
error: `std::iter::empty()` is shorter than `std::iter::Empty::default()` and same functionality
1+
error: `std::iter::empty()` is the more idiomatic way
22
--> $DIR/default_instead_of_iter_empty.rs:13:13
33
|
44
LL | let _ = std::iter::Empty::<usize>::default();
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::iter::empty::<usize>()`
66
|
77
= note: `-D clippy::default-instead-of-iter-empty` implied by `-D warnings`
88

9-
error: `std::iter::empty()` is shorter than `std::iter::Empty::default()` and same functionality
9+
error: `std::iter::empty()` is the more idiomatic way
1010
--> $DIR/default_instead_of_iter_empty.rs:14:13
1111
|
1212
LL | let _ = std::iter::Empty::<HashMap<usize, usize>>::default();
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::iter::empty::<HashMap<usize, usize>>()`
1414

15-
error: `std::iter::empty()` is shorter than `std::iter::Empty::default()` and same functionality
15+
error: `std::iter::empty()` is the more idiomatic way
1616
--> $DIR/default_instead_of_iter_empty.rs:15:41
1717
|
1818
LL | let _foo: std::iter::Empty<usize> = std::iter::Empty::default();

0 commit comments

Comments
 (0)