On Sat, Dec 15, 2012 at 7:02 PM, Nathan <[email protected]> wrote: > > Also, traverse should probably belong in its own trait. > > > > It seems like traversal over keys *and* values is quite useful, > because it's common for applications to need both, and doing a > separate lookup when a traversal is already "close to" the value would > be a shame (changing asymptotic bounds on some applications). > > There is already an Iter trait. Is traversal simply an Iter over > either K or (K, V) ?
Thanks, I converted my code to implement BaseIter (although my implementation of size_hint is a little hacky since I'm not tracking the size of the tree) > > The private methods are part of the RBMap specialization of the Map trait > > and are required to reduce boilerplate. They don't belong in a Map trait > > proper. > > > > The rust way to do this is to have the trait methods call helper > functions which are in scope, but not attached to the trait, I > believe. Aha, that helps things click for me. Thanks again, Steve
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
