Uh oh!
There was an error while loading. Please reload this page.
replace BitAndAssign example with something more evocative - #35927
Conversation
GuillaumeGomez
commented
Aug 23, 2016
Like discussed on IRC, please write simpler examples. |
matthew-piziak
commented
Aug 23, 2016
Copy-pasting the IRC discussion here. I'd link to the logs, but I can't prevent them from truncating prematurely. https://gist.github.com/matthew-piziak/a2dd18e897eb3d4113459a945d85296b |
ollie27
commented
Aug 25, 2016
I like this example, however it's not clear what should happen if the use std::ops::BitAndAssign;#[derive(Debug,PartialEq)]structBooleanVector{value:[bool;4],}implBitAndAssignforBooleanVector{fnbitand_assign(&mutself,rhs:Self){for(x, y)inself.value.iter_mut().zip(&rhs.value){*x &= *y;}}}fnmain(){letmut bv = BooleanVector{value:[true,true,false,false]};
bv &= BooleanVector{value:[true,false,true,false]};let expected = BooleanVector{value:[true,false,false,false]};assert_eq!(bv, expected);} |
This pull request is based on the discussion in PR rust-lang#35927. Add a module-level note that `&&` and `||` are short-circuiting operators and not overloadable. Add a simple `Scalar` example that lifts the `&` operator to a trivial struct tuple. Make `BooleanVector` a struct tuple. Derive `PartialEq` for `BooleanVector` instead of implementing it. Adds a `fn main` wrapper so that the example can integrate with Rust Playground. simplified bitand expression add a comment explaining what "rhs" means
…=GuillaumeGomez improve `BitAnd` trait documentation This pull request is based on the discussion in PR rust-lang#35927. Add a module-level note that `&&` and `||` are short-circuiting operators and not overloadable. Add a simple `Scalar` example that lifts the `&` operator to a trivial struct tuple. Make `BooleanVector` a struct tuple. Derive `PartialEq` for `BooleanVector` instead of implementing it. Adds a `fn main` wrapper so that the example can integrate with Rust Playground.
matthew-piziak
commented
Aug 29, 2016
I've taken the improvements in #35993 and applied them to this PR. I figured that a simple |
…=GuillaumeGomez improve `BitAnd` trait documentation This pull request is based on the discussion in PR rust-lang#35927. Add a module-level note that `&&` and `||` are short-circuiting operators and not overloadable. Add a simple `Scalar` example that lifts the `&` operator to a trivial struct tuple. Make `BooleanVector` a struct tuple. Derive `PartialEq` for `BooleanVector` instead of implementing it. Adds a `fn main` wrapper so that the example can integrate with Rust Playground.
matthew-piziak
commented
Aug 29, 2016
@bors retry |
…=GuillaumeGomez improve `BitAnd` trait documentation This pull request is based on the discussion in PR rust-lang#35927. Add a module-level note that `&&` and `||` are short-circuiting operators and not overloadable. Add a simple `Scalar` example that lifts the `&` operator to a trivial struct tuple. Make `BooleanVector` a struct tuple. Derive `PartialEq` for `BooleanVector` instead of implementing it. Adds a `fn main` wrapper so that the example can integrate with Rust Playground.
…=GuillaumeGomez improve `BitAnd` trait documentation This pull request is based on the discussion in PR rust-lang#35927. Add a module-level note that `&&` and `||` are short-circuiting operators and not overloadable. Add a simple `Scalar` example that lifts the `&` operator to a trivial struct tuple. Make `BooleanVector` a struct tuple. Derive `PartialEq` for `BooleanVector` instead of implementing it. Adds a `fn main` wrapper so that the example can integrate with Rust Playground.
This is the augmented-assignment version of PR rust-lang#35809. r? @GuillaumeGomez improved documentation a la PR rust-lang#35993
dadab30 to
ba69bc8CompareGuillaumeGomez
commented
Aug 31, 2016
Thanks! @bors: r+ rollup |
bors
commented
Aug 31, 2016
📌 Commit ba69bc8 has been approved by |
…, r=GuillaumeGomez replace `BitAndAssign` example with something more evocative This is the augmented-assignment version of PR rust-lang#35809. r? @GuillaumeGomez
This is the augmented-assignment version of PR #35809.
r? @GuillaumeGomez