2020-10-01 12:04:19 -05:00
error: usage of `FromIterator::from_iter`
2023-06-12 09:04:34 -05:00
--> $DIR/from_iter_instead_of_collect.rs:19:9
2020-09-10 13:18:23 -05:00
|
2021-05-22 13:47:11 -05:00
LL | <Self as FromIterator<bool>>::from_iter(iter.into_iter().copied())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `.collect()` instead of `::from_iter()`: `iter.into_iter().copied().collect::<Self>()`
2020-09-10 13:18:23 -05:00
|
= note: `-D clippy::from-iter-instead-of-collect` implied by `-D warnings`
2020-10-01 12:04:19 -05:00
error: usage of `FromIterator::from_iter`
2023-06-12 09:04:34 -05:00
--> $DIR/from_iter_instead_of_collect.rs:25:13
2021-05-22 13:47:11 -05:00
|
LL | let _ = Vec::from_iter(iter_expr);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `.collect()` instead of `::from_iter()`: `iter_expr.collect::<Vec<_>>()`
error: usage of `FromIterator::from_iter`
2023-06-12 09:04:34 -05:00
--> $DIR/from_iter_instead_of_collect.rs:27:13
2020-09-10 13:18:23 -05:00
|
2021-02-04 12:08:08 -06:00
LL | let _ = HashMap::<usize, &i8>::from_iter(vec![5, 5, 5, 5].iter().enumerate());
2021-02-09 10:38:16 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `.collect()` instead of `::from_iter()`: `vec![5, 5, 5, 5].iter().enumerate().collect::<HashMap<usize, &i8>>()`
2020-09-10 13:18:23 -05:00
2021-01-31 14:43:35 -06:00
error: usage of `FromIterator::from_iter`
2023-06-12 09:04:34 -05:00
--> $DIR/from_iter_instead_of_collect.rs:32:19
2021-01-31 14:43:35 -06:00
|
LL | assert_eq!(a, Vec::from_iter(0..3));
2021-02-09 10:38:16 -06:00
| ^^^^^^^^^^^^^^^^^^^^ help: use `.collect()` instead of `::from_iter()`: `(0..3).collect::<Vec<_>>()`
2021-01-31 14:43:35 -06:00
error: usage of `FromIterator::from_iter`
2023-06-12 09:04:34 -05:00
--> $DIR/from_iter_instead_of_collect.rs:33:19
2021-02-09 10:38:16 -06:00
|
LL | assert_eq!(a, Vec::<i32>::from_iter(0..3));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `.collect()` instead of `::from_iter()`: `(0..3).collect::<Vec<i32>>()`
error: usage of `FromIterator::from_iter`
2023-06-12 09:04:34 -05:00
--> $DIR/from_iter_instead_of_collect.rs:35:17
2021-01-31 14:43:35 -06:00
|
LL | let mut b = VecDeque::from_iter(0..3);
2021-02-09 10:38:16 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `.collect()` instead of `::from_iter()`: `(0..3).collect::<VecDeque<_>>()`
error: usage of `FromIterator::from_iter`
2023-06-12 09:04:34 -05:00
--> $DIR/from_iter_instead_of_collect.rs:38:17
2021-02-09 10:38:16 -06:00
|
LL | let mut b = VecDeque::<i32>::from_iter(0..3);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `.collect()` instead of `::from_iter()`: `(0..3).collect::<VecDeque<i32>>()`
error: usage of `FromIterator::from_iter`
2023-06-12 09:04:34 -05:00
--> $DIR/from_iter_instead_of_collect.rs:43:21
2021-02-09 10:38:16 -06:00
|
LL | let mut b = collections::VecDeque::<i32>::from_iter(0..3);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `.collect()` instead of `::from_iter()`: `(0..3).collect::<collections::VecDeque<i32>>()`
2021-01-31 14:43:35 -06:00
2021-02-04 12:08:08 -06:00
error: usage of `FromIterator::from_iter`
2023-06-12 09:04:34 -05:00
--> $DIR/from_iter_instead_of_collect.rs:48:14
2021-02-04 12:08:08 -06:00
|
LL | let bm = BTreeMap::from_iter(values.iter().cloned());
2021-02-09 10:38:16 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `.collect()` instead of `::from_iter()`: `values.iter().cloned().collect::<BTreeMap<_, _>>()`
2021-02-04 12:08:08 -06:00
error: usage of `FromIterator::from_iter`
2023-06-12 09:04:34 -05:00
--> $DIR/from_iter_instead_of_collect.rs:49:19
2021-02-04 12:08:08 -06:00
|
LL | let mut bar = BTreeMap::from_iter(bm.range(0..2));
2021-02-09 10:38:16 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `.collect()` instead of `::from_iter()`: `bm.range(0..2).collect::<BTreeMap<_, _>>()`
2021-02-04 12:08:08 -06:00
error: usage of `FromIterator::from_iter`
2023-06-12 09:04:34 -05:00
--> $DIR/from_iter_instead_of_collect.rs:52:19
2021-02-04 12:08:08 -06:00
|
LL | let mut bts = BTreeSet::from_iter(0..3);
2021-02-09 10:38:16 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `.collect()` instead of `::from_iter()`: `(0..3).collect::<BTreeSet<_>>()`
2021-02-04 12:08:08 -06:00
error: usage of `FromIterator::from_iter`
2023-06-12 09:04:34 -05:00
--> $DIR/from_iter_instead_of_collect.rs:56:17
2021-02-04 12:08:08 -06:00
|
LL | let _ = collections::BTreeSet::from_iter(0..3);
2021-02-09 10:38:16 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `.collect()` instead of `::from_iter()`: `(0..3).collect::<collections::BTreeSet<_>>()`
error: usage of `FromIterator::from_iter`
2023-06-12 09:04:34 -05:00
--> $DIR/from_iter_instead_of_collect.rs:57:17
2021-02-09 10:38:16 -06:00
|
LL | let _ = collections::BTreeSet::<u32>::from_iter(0..3);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `.collect()` instead of `::from_iter()`: `(0..3).collect::<collections::BTreeSet<u32>>()`
error: usage of `FromIterator::from_iter`
2023-06-12 09:04:34 -05:00
--> $DIR/from_iter_instead_of_collect.rs:60:15
2021-02-09 10:38:16 -06:00
|
LL | for _i in Vec::from_iter([1, 2, 3].iter()) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `.collect()` instead of `::from_iter()`: `[1, 2, 3].iter().collect::<Vec<_>>()`
error: usage of `FromIterator::from_iter`
2023-06-12 09:04:34 -05:00
--> $DIR/from_iter_instead_of_collect.rs:61:15
2021-02-09 10:38:16 -06:00
|
LL | for _i in Vec::<&i32>::from_iter([1, 2, 3].iter()) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `.collect()` instead of `::from_iter()`: `[1, 2, 3].iter().collect::<Vec<&i32>>()`
2021-02-04 12:08:08 -06:00
2021-05-22 13:47:11 -05:00
error: aborting due to 15 previous errors
2020-09-10 13:18:23 -05:00