Closed roblabla closed 8 years ago
Looks really nice! The String
/&str
tests are great, we don't ever want to lose that feature! 👌
Let me know when you feel this is sufficiently tested, and I'll merge it.
It'd be great if you could squash the tiny fixup commits too
Yup. I was wondering, is there a good way to compare subtries ? Maybe we should implement PartialEq on SubTries ? Cuz the problem is, I'd like to make sure that, for instance, trie.subtrie("/boot").unwrap() == trie.subtrie(&"/boot").unwrap()
(to make sure we don't treat those differently, just in case. Might be over-testing but... shrug).
Anyhow, would it even make sense to implement comparison for subtries ?
Sorry it has taken me a while to reply, I think PartialEq for subtries would be fine, just check that the prefix is the same and that iterators over the keys and values return the same thing.
I'm inclined to merge this. I'm happy to add a few more tests myself. Sound good?
Sounds good :D
Use std::borrow::Borrow for all the methods that use &K.
The feature itself is done, I'm still writing some tests though.
Fixes #13