-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement BitOps for TrieSet #19518
Implement BitOps for TrieSet #19518
Conversation
r? @gankro |
@@ -463,6 +462,30 @@ impl Extend<uint> for TrieSet { | |||
} | |||
} | |||
|
|||
impl BitOr<TrieSet, TrieSet> for TrieSet { | |||
fn bitor(&self, rhs: &TrieSet) -> TrieSet { | |||
self.union(rhs).collect::<TrieSet>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the ::<TrieSet>
annotation necessary? This should be easily inferred by the compiler (if it's not, we should be logging an issue).
implementation and tests are correct, just some style nits. |
c45afa5
to
d424af4
Compare
@gankro OK, hopefully all of your comments are addressed! :) |
Cool. Looks like bit ops for BTreeSet are being taken care of presently, but I think I'll work on implementing them for TreeSet next. |
d424af4
to
309ab34
Compare
@gankro doctests and stability message added. Also, it looks like the old version of this is currently in the large rollup that's been trying to go through lately since it was r+'ed initially, so not sure how to proceed w.r.t. that. |
I'll hash it out with cmr. Worst-case we can make the doc changes a seperate PR, but I don't think we'll need to. |
Cool, just let me know if I need to do anything further! |
Just so I don't waste their time by breaking the rollup with this change: have you locally confirmed that the code in the docs checks out in our testing? |
Yes. |
Great, thanks! |
Implement the
BitOr
,BitAnd
,BitXor
, andSub
traits fromstd::ops
for TrieSet. The behavior of these operator overloads is consistent with RFC 235.