Improve: error message
This commit is contained in:
parent
0ab96ba2c0
commit
e320dd3042
3 changed files with 3 additions and 3 deletions
|
|
@ -5,7 +5,7 @@ use std::iter::FromIterator;
|
|||
|
||||
fn main() {
|
||||
let iter_expr = std::iter::repeat(5).take(5);
|
||||
|
||||
Vec::from_iter(iter_expr);
|
||||
|
||||
HashMap::<usize, &i8>::from_iter(vec![5, 5, 5, 5].iter().enumerate());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error: use `.collect()` instead of `::from_iter()`
|
||||
--> $DIR/from_iter_instead_of_collect.rs:9:5
|
||||
--> $DIR/from_iter_instead_of_collect.rs:8:5
|
||||
|
|
||||
LL | Vec::from_iter(iter_expr);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: ``iter_expr.collect()``
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue