rust/tests/ui/from_iter_instead_of_collect.stderr

20 lines
708 B
Plaintext
Raw Normal View History

error: use `.collect()` instead of `::from_iter()`
2020-10-01 05:36:17 -05:00
--> $DIR/from_iter_instead_of_collect.rs:10:9
|
2020-10-01 05:36:17 -05:00
LL | Vec::from_iter(iter_expr);
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::from-iter-instead-of-collect` implied by `-D warnings`
= help: consider using `iter_expr.collect()`
error: use `.collect()` instead of `::from_iter()`
2020-10-01 05:36:17 -05:00
--> $DIR/from_iter_instead_of_collect.rs:11:9
|
2020-10-01 05:36:17 -05:00
LL | HashMap::<usize, &i8>::from_iter(vec![5, 5, 5, 5].iter().enumerate());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-10-01 05:36:17 -05:00
= help: consider using `vec![5, 5, 5, 5].iter().enumerate().collect()`
error: aborting due to 2 previous errors