Skip to content

Add other bitwise ops for bitflag enums #698

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

Merged
merged 1 commit into from
May 11, 2017

Conversation

jonhoo
Copy link
Contributor

@jonhoo jonhoo commented May 11, 2017

Currently, bitflag enums only implement BitOr. However, it is fairly common to & bitflags, requiring the BitAnd trait to be implemented as well. I also implemented BitOrAssign and BitAndAssign in the process.

@fitzgen
Copy link
Member

fitzgen commented May 11, 2017

Looks great -- thanks @jonhoo!

We might want to also implement all the bitwise operations, but this obviously is no reason not to land this patch now.

Thanks again!

@bors-servo r+

@bors-servo
Copy link

📌 Commit dafa5a5 has been approved by fitzgen

@bors-servo
Copy link

⌛ Testing commit dafa5a5 with merge 62ffd41...

bors-servo pushed a commit that referenced this pull request May 11, 2017
Add other bitwise ops for bitflag enums

Currently, bitflag enums only implement `BitOr`. However, it is fairly common to `&` bitflags, requiring the `BitAnd` trait to be implemented as well. I also implemented `BitOrAssign` and `BitAndAssign` in the process.
@bors-servo
Copy link

☀️ Test successful - status-travis
Approved by: fitzgen
Pushing 62ffd41 to master...

@bors-servo bors-servo merged commit dafa5a5 into rust-lang:master May 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants