Indexing using Into<usize>

59 points Original-Elk-2117

Im kinda sick of writing \as usize\\ everytime I index a slice, vec, etc.

I don't understand why can't the compiler automatically attempt to cast the expression in \\\[\\]\\ as \usize\\.

I tried implementing it myself but I got some errors I don't really understand:

https://preview.redd.it/a3sbge0a154c1.png?width=1405&format=png&auto=webp&s=3a44b8ffef2b99fc5c52a4c79669a49ba9539913

Error: Type parameter F must be used as the type parameter for some local type

Does anyone know of a comfortable way to get around this?