Is it me or is this kind of redundant?

88 points sylvan_mfr

Say I have a type T that can be initialized with integers. Rust syntax would make me do:

let a: T = 1.into();

Why must I include the into()? If Rust can already infer the type it needs to become, why can't I do

let a: T = 1;

as some syntactic sugar for 1.into()? Does anyone else find this kind of annoying?

Since the code I gave is a bad example, this is the code I had to write that motivated me to write this post, when I was testing a matrix type whose entries were a type that is initialized by integers:

​

https://preview.redd.it/hl8yibn9ak7c1.png?width=1986&format=png&auto=webp&s=227805d477ab1b5d30173a2533abb195bbe06840