Improve: error message

This commit is contained in:
Piti the little Light 2020-10-01 18:34:36 +02:00 committed by flip1995
parent 0ab96ba2c0
commit e320dd3042
No known key found for this signature in database
GPG key ID: AFC0354489087877
3 changed files with 3 additions and 3 deletions

View file

@ -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());
}

View file

@ -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()``