I sometimes like to call FromIterator's from_iter() (like Vec::from_iter() or HashMap::from_iter()) directly, particularly when the compiler cannot infer the return type for collect(), and even more particularly when that return type is using some type arguments that the compiler could infer.
However, recently clippy started warning about using from_iter() directly. This made me wonder if people mostly prefer using collect() even if turbofishing is required, or if others also like to use from_iter() directly for this purpose. I feel like this change makes the code slightly worse:
There's no turbofish required in scottmcm's suggestion, so I'm not sure which of the options is supposed to represent it? (Did you copy and paste and forget to delete that part?)
I don't like wrapping long iterator chains in from_iter, like in your example. But if I already have the iterator in a local or it's a short expression, then from_iter is nice -- especially if I can use an implicit IntoIterator.
let refs1 = Vec::from_iter(&collection);
let refs2 = collection.iter().collect::<Vec<_>>();
let refs3: Vec<_> = collection.iter().collect();
I do use collect in both forms for longer iterators, usually with type annotation if I am binding to a local, or turbofish otherwise.