-
Notifications
You must be signed in to change notification settings - Fork 13.4k
replace BitAnd
example with something more evocative of bitwise AND
#35809
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
/// .iter() | ||
/// .zip(rhs.value.iter()) | ||
/// .map(|(x, y)| *x && *y) | ||
/// .collect(), |
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.
what happens if you run this code (not inside of ///
) through rustfmt
?
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.
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.
reformat method chain according to ubsan Rustic Style Guide https://ubsan.github.io/style/
a36a9dc
to
9f88f8a
Compare
@bors: r+ rollup |
📌 Commit 9f88f8a has been approved by |
… r=GuillaumeGomez replace `BitAnd` example with something more evocative of bitwise AND
These are exactly equivalent to PR rust-lang#35809, with one caveat: I do not believe there is a non-bitwise binary "xor" operator in Rust, so here it's expressed as (a || b) && !(a && b). r? @GuillaumeGomez improved documentation a la PR rust-lang#35993
This is the augmented-assignment version of PR rust-lang#35809. r? @GuillaumeGomez improved documentation a la PR rust-lang#35993
… r=GuillaumeGomez add evocative examples for `BitOr` and `BitXor` These are exactly equivalent to PR rust-lang#35809, with one caveat: I do not believe there is a non-bitwise binary XOR operator in Rust, so here it's expressed as `(a || b) && !(a && b)`. Alternative decompositions are `(a && !b) || (!a && b)` and `(a || b) && (!a || !b)`. Let me know if you think one of those would be clearer. r? @GuillaumeGomez
… r=GuillaumeGomez add evocative examples for `BitOr` and `BitXor` These are exactly equivalent to PR rust-lang#35809, with one caveat: I do not believe there is a non-bitwise binary XOR operator in Rust, so here it's expressed as `(a || b) && !(a && b)`. Alternative decompositions are `(a && !b) || (!a && b)` and `(a || b) && (!a || !b)`. Let me know if you think one of those would be clearer. r? @GuillaumeGomez
… r=GuillaumeGomez add evocative examples for `BitOr` and `BitXor` These are exactly equivalent to PR rust-lang#35809, with one caveat: I do not believe there is a non-bitwise binary XOR operator in Rust, so here it's expressed as `(a || b) && !(a && b)`. Alternative decompositions are `(a && !b) || (!a && b)` and `(a || b) && (!a || !b)`. Let me know if you think one of those would be clearer. r? @GuillaumeGomez
…, r=GuillaumeGomez replace `BitAndAssign` example with something more evocative This is the augmented-assignment version of PR rust-lang#35809. r? @GuillaumeGomez
No description provided.