Skip to content

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

Merged
bors merged 1 commit into
rust-lang:masterfrom
matthew-piziak:bitwise-and-example
Aug 23, 2016
Merged

replace BitAnd example with something more evocative of bitwise AND#35809
bors merged 1 commit into
rust-lang:masterfrom
matthew-piziak:bitwise-and-example

Conversation

@matthew-piziak

Copy link
Copy Markdown
Contributor

No description provided.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @alexcrichton

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

@matthew-piziak

Copy link
Copy Markdown
ContributorAuthor

r? @steveklabnik

Comment threadsrc/libcore/ops.rs Outdated

Copy link
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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
Copy Markdown
Member

@bors: r+ rollup

@bors

bors commented Aug 22, 2016

Copy link
Copy Markdown
Collaborator

📌 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
@sophiajtsophiajt mentioned this pull request Aug 22, 2016
bors added a commit that referenced this pull request Aug 22, 2016
@bors
bors merged commit 9f88f8a into rust-lang:masterAug 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 freeto 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

@matthew-piziak@rust-highfive@GuillaumeGomez@bors@steveklabnik@alexcrichton