4 ms·
In Rust, <> are used for type arguments. E.g. if you make a function with a generic type, it would be `fn my_func<T>(arg1: T) { ... }` Now, what we have here i
by Tehnix 5y ago
In Rust, <> are used for type arguments. E.g. if you make a function with a generic type, it would be `fn my_func<T>(arg1: T) { ... }`
Now, what we have here is commonly referred to as the Turbo Fish[0] operator (the `::<>` syntax). In this case it's there to help let the compiler know which concrete type you want to create your new `ArrayVec` with :)
[0]: https://doc.rust-lang.org/1.30.0/book/first-edition/generics.html#resolving-ambiguities https://doc.rust-lang.org/1.30.0/book/first-edition/generics...