Skip to content

Commit

Permalink
Trivial fixes to bitwise operator documentation
Browse files Browse the repository at this point in the history
Added fixes to documentation of `BitAnd`, `BitOr`, `BitXor` and
`BitAndAssign`, where the documentation for implementation on
`Vector<bool>` was using logical operators in place of the bitwise
operators.

r? @steveklabnik
cc rust-lang#78619
  • Loading branch information
gabhijit committed Nov 1, 2020
1 parent 4f7612a commit 66d68cd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions library/core/src/ops/bit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
/// assert_eq!(lhs.len(), rhs.len());
/// Self(lhs.iter()
/// .zip(rhs.iter())
/// .map(|(x, y)| *x && *y)
/// .map(|(x, y)| *x & *y)
/// .collect())
/// }
/// }
Expand Down Expand Up @@ -207,7 +207,10 @@ bitand_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
/// fn bitor(self, Self(rhs): Self) -> Self::Output {
/// let Self(lhs) = self;
/// assert_eq!(lhs.len(), rhs.len());
/// Self(lhs.iter().zip(rhs.iter()).map(|(x, y)| *x || *y).collect())
/// Self(lhs.iter()
/// .zip(rhs.iter())
/// .map(|(x, y)| *x | *y)
/// .collect())
/// }
/// }
///
Expand Down Expand Up @@ -304,7 +307,7 @@ bitor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
/// assert_eq!(lhs.len(), rhs.len());
/// Self(lhs.iter()
/// .zip(rhs.iter())
/// .map(|(x, y)| (*x || *y) && !(*x && *y))
/// .map(|(x, y)| *x ^ *y))
/// .collect())
/// }
/// }
Expand Down Expand Up @@ -646,7 +649,7 @@ shr_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
/// *self = Self(self.0
/// .iter()
/// .zip(rhs.0.iter())
/// .map(|(x, y)| *x && *y)
/// .map(|(x, y)| *x & *y)
/// .collect());
/// }
/// }
Expand Down

0 comments on commit 66d68cd

Please sign in to comment.