Skip to content

Commit

Permalink
rewrite a message in the suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoto7250 committed Jun 17, 2022
1 parent 9ecc1b8 commit ee253ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/default_instead_of_iter_empty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl<'tcx> LateLintPass<'tcx> for DefaultIterEmpty {
cx,
DEFAULT_INSTEAD_OF_ITER_EMPTY,
expr.span,
"`std::iter::empty()` is shorter than `std::iter::Empty::default()` and same functionality",
"`std::iter::empty()` is the more idiomatic way",
"try",
sugg,
applicability,
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/default_instead_of_iter_empty.stderr
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
error: `std::iter::empty()` is shorter than `std::iter::Empty::default()` and same functionality
error: `std::iter::empty()` is the more idiomatic way
--> $DIR/default_instead_of_iter_empty.rs:13:13
|
LL | let _ = std::iter::Empty::<usize>::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::iter::empty::<usize>()`
|
= note: `-D clippy::default-instead-of-iter-empty` implied by `-D warnings`

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

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

0 comments on commit ee253ad

Please sign in to comment.