Impl for Struct that uses Generics and associated methods that doesn't use the generic
⚓ Rust 📅 2025-11-18 👤 surdeus 👁️ 11So I have a struct like this which uses a generic.
Then I have an impl block like this
![]()
I have added a method to the struct that does not use the generic at all.
![]()
But my linter tells me I still have to specify the generic field when calling this method through my struct. So it ends up looking something like this.
![]()
Is there any way I can still have the function associated with the struct without having to specify the generic like this in the function call? I would like it to look like Matrix::permutations(&numbers); instead of Matrix::<f32>::permutations(&numbers).
10 posts - 4 participants
🏷️ Rust_feed
