yosh on Nostr: Interesting that a lot of traits in Rust are verbs (“Debug”, “Extend”, ...
Interesting that a lot of traits in Rust are verbs (“Debug”, “Extend”, “Read”, “Write”) but we also have “Iterator”.
The closest relation I can find is the “Hasher" trait, which is passed as an argument to the “Hash” trait, and is the stateful part that actually performs the hashing.
In that sense I don't actually think that “Iterator" is a misnomer either since it’s also stateful. But I now do wonder whether we maybe would have been better off naming “IntoIterator" as “Iterate" instead.
The closest relation I can find is the “Hasher" trait, which is passed as an argument to the “Hash” trait, and is the stateful part that actually performs the hashing.
In that sense I don't actually think that “Iterator" is a misnomer either since it’s also stateful. But I now do wonder whether we maybe would have been better off naming “IntoIterator" as “Iterate" instead.