Skip to content
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

replace BitAnd example with something more evocative of bitwise AND #35809

Merged
merged 1 commit into from
Aug 23, 2016

Conversation

matthew-piziak
Copy link
Contributor

No description provided.

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@matthew-piziak
Copy link
Contributor Author

r? @steveklabnik

/// .iter()
/// .zip(rhs.value.iter())
/// .map(|(x, y)| *x && *y)
/// .collect(),
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did (see modeline).

But caveat: I first indented iter(), and then invoked rustfmt. In a moment I'll throw up another version that rustfmt accepts.

screen shot 2016-08-18 at 5 23 47 pm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised rustfmt accepts this since it goes over the column limit.

screen shot 2016-08-18 at 5 28 07 pm

@GuillaumeGomez
Copy link
Member

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Aug 22, 2016

📌 Commit 9f88f8a has been approved by GuillaumeGomez

sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 22, 2016
… r=GuillaumeGomez

replace `BitAnd` example with something more evocative of bitwise AND
bors added a commit that referenced this pull request Aug 22, 2016
@bors bors merged commit 9f88f8a into rust-lang:master Aug 23, 2016
@matthew-piziak matthew-piziak deleted the bitwise-and-example branch August 23, 2016 15:13
matthew-piziak added a commit to matthew-piziak/rust that referenced this pull request Aug 30, 2016
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
matthew-piziak added a commit to matthew-piziak/rust that referenced this pull request Aug 30, 2016
This is the augmented-assignment version of PR rust-lang#35809.

r? @GuillaumeGomez

improved documentation a la PR rust-lang#35993
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 30, 2016
… 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
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 31, 2016
… 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
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 31, 2016
… 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
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Aug 31, 2016
…, r=GuillaumeGomez

replace `BitAndAssign` example with something more evocative

This is the augmented-assignment version of PR rust-lang#35809.

r? @GuillaumeGomez
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.

6 participants