A small feature request, maybe something like Vec::new_reserved(size: usize) could be useful? Sometimes when extracting data in code I keep writing long structures like:
// This
{
let mut v = vec![];
v.reserve(space_hint);
v
}
// Can be replaced with
Vec::new_reserved(space_hint)
They are not very readable and might be useful for others too. It might come in handy for iterators too, since now ones that have a size_hint can request the required amount of space when collecting:
Sounds like a reasonable idea to me. I tried searching for pre-existing proposals in the relevant issue tracker and didn’t see anything so far. Feel free to open a new one ^^