]> git.lizzy.rs Git - rust.git/blob - tests/ui/from_iter_instead_of_collect.stderr
Add tests for `from_iter_instead_of_collect`
[rust.git] / tests / ui / from_iter_instead_of_collect.stderr
1 error: use `.collect()` instead of `::from_iter()`
2   --> $DIR/from_iter_instead_of_collect.rs:10:5
3    |
4 LL |     Vec::from_iter(iter_expr);
5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: `-D clippy::from-iter-instead-of-collect` implied by `-D warnings`
8    = help: consider using `iter_expr.collect()`
9
10 error: use `.collect()` instead of `::from_iter()`
11   --> $DIR/from_iter_instead_of_collect.rs:11:5
12    |
13 LL |     HashMap::<usize, &i8>::from_iter(vec![5,5,5,5].iter().enumerate());
14    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15    |
16    = help: consider using `vec![5,5,5,5].iter().enumerate().collect()`
17
18 error: aborting due to 2 previous errors
19