Suggestion: allow `vec![T]`


#1

I am not sure if feasible altogether, but in my opinion it would be convenient to define an empty Vec as follows:

let v = vec![T];

instead of:

let v: Vec<T> = vec![];

or:

let v: Vec<T> = Vec::new();

#2

The syntax currently is:

let v = Vec::<T>::new();


#3

I doubt this is possible.

struct x {}
let x = 0i32;
let v = vec![x]; // what is v?

#4

Also, you usually don’t need to specify the type, as it will be inferred.


#5

Besides, it’s not at all intuitive to the reader without an explanation what a type inside a macro is when said macro usually takes values, not types.