It is common when your code is generic-heavy. For example, in an algebra library.
It is only short in the example I provided. In practice, I prefer using meaningful names (such as <Key, Value, Left, Right>
), short names are cryptic.
If that is the case, then you have no choice but to use the old syntax. I see no problem here.
impl
must always provide enough generic params required but the struct, no more, no less. Or did I misinterpret "different set"?
For the first proposed variant (impl Self
), one may use impl<AdditionalParams> Self
to provide additional generic params, or just write additional generic params directly in the fn
declarations.
For the second proposed variant (just fn
), write additional generic params directly in the fn
declarations.