2 ms·
The thing I found confusing with traits and their generic system was the choice to include "associative types" for out types instead of also defining them in a
by vips7L 6y ago
The thing I found confusing with traits and their generic system was the choice to include "associative types" for out types instead of also defining them in a generic bound:
trait Iterator {
type Out;
fn next() -> Option<Out>;
}
vs
trait Iterator<T> {
fn next() -> Option<T>;
}
Multiple ways to do something has made it harder to understand.