1515/// }
1616///
1717/// impl Not for Answer {
18- /// type Output = Answer ;
18+ /// type Output = Self ;
1919///
2020/// fn not(self) -> Self::Output {
2121/// match self {
@@ -85,7 +85,7 @@ not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
8585///
8686/// // rhs is the "right-hand side" of the expression `a & b`
8787/// fn bitand(self, rhs: Self) -> Self::Output {
88- /// Scalar (self.0 & rhs.0)
88+ /// Self (self.0 & rhs.0)
8989/// }
9090/// }
9191///
@@ -106,10 +106,13 @@ not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
106106/// impl BitAnd for BooleanVector {
107107/// type Output = Self;
108108///
109- /// fn bitand(self, BooleanVector (rhs): Self) -> Self::Output {
110- /// let BooleanVector (lhs) = self;
109+ /// fn bitand(self, Self (rhs): Self) -> Self::Output {
110+ /// let Self (lhs) = self;
111111/// assert_eq!(lhs.len(), rhs.len());
112- /// BooleanVector(lhs.iter().zip(rhs.iter()).map(|(x, y)| *x && *y).collect())
112+ /// Self(lhs.iter()
113+ /// .zip(rhs.iter())
114+ /// .map(|(x, y)| *x && *y)
115+ /// .collect())
113116/// }
114117/// }
115118///
@@ -179,8 +182,8 @@ bitand_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
179182/// type Output = Self;
180183///
181184/// // rhs is the "right-hand side" of the expression `a | b`
182- /// fn bitor(self, rhs: Self) -> Self {
183- /// Scalar (self.0 | rhs.0)
185+ /// fn bitor(self, rhs: Self) -> Self::Output {
186+ /// Self (self.0 | rhs.0)
184187/// }
185188/// }
186189///
@@ -201,10 +204,10 @@ bitand_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
201204/// impl BitOr for BooleanVector {
202205/// type Output = Self;
203206///
204- /// fn bitor(self, BooleanVector (rhs): Self) -> Self::Output {
205- /// let BooleanVector (lhs) = self;
207+ /// fn bitor(self, Self (rhs): Self) -> Self::Output {
208+ /// let Self (lhs) = self;
206209/// assert_eq!(lhs.len(), rhs.len());
207- /// BooleanVector (lhs.iter().zip(rhs.iter()).map(|(x, y)| *x || *y).collect())
210+ /// Self (lhs.iter().zip(rhs.iter()).map(|(x, y)| *x || *y).collect())
208211/// }
209212/// }
210213///
@@ -275,7 +278,7 @@ bitor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
275278///
276279/// // rhs is the "right-hand side" of the expression `a ^ b`
277280/// fn bitxor(self, rhs: Self) -> Self::Output {
278- /// Scalar (self.0 ^ rhs.0)
281+ /// Self (self.0 ^ rhs.0)
279282/// }
280283/// }
281284///
@@ -296,13 +299,13 @@ bitor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
296299/// impl BitXor for BooleanVector {
297300/// type Output = Self;
298301///
299- /// fn bitxor(self, BooleanVector (rhs): Self) -> Self::Output {
300- /// let BooleanVector (lhs) = self;
302+ /// fn bitxor(self, Self (rhs): Self) -> Self::Output {
303+ /// let Self (lhs) = self;
301304/// assert_eq!(lhs.len(), rhs.len());
302- /// BooleanVector (lhs.iter()
303- /// .zip(rhs.iter())
304- /// .map(|(x, y)| (*x || *y) && !(*x && *y))
305- /// .collect())
305+ /// Self (lhs.iter()
306+ /// .zip(rhs.iter())
307+ /// .map(|(x, y)| (*x || *y) && !(*x && *y))
308+ /// .collect())
306309/// }
307310/// }
308311///
@@ -375,9 +378,9 @@ bitxor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
375378/// impl Shl<Scalar> for Scalar {
376379/// type Output = Self;
377380///
378- /// fn shl(self, Scalar (rhs): Self) -> Scalar {
379- /// let Scalar (lhs) = self;
380- /// Scalar (lhs << rhs)
381+ /// fn shl(self, Self (rhs): Self) -> Self::Output {
382+ /// let Self (lhs) = self;
383+ /// Self (lhs << rhs)
381384/// }
382385/// }
383386///
@@ -400,10 +403,10 @@ bitxor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
400403/// fn shl(self, rhs: usize) -> Self::Output {
401404/// // Rotate the vector by `rhs` places.
402405/// let (a, b) = self.vec.split_at(rhs);
403- /// let mut spun_vector: Vec<T> = vec![];
406+ /// let mut spun_vector = vec![];
404407/// spun_vector.extend_from_slice(b);
405408/// spun_vector.extend_from_slice(a);
406- /// SpinVector { vec: spun_vector }
409+ /// Self { vec: spun_vector }
407410/// }
408411/// }
409412///
@@ -493,9 +496,9 @@ shl_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 isize i128 }
493496/// impl Shr<Scalar> for Scalar {
494497/// type Output = Self;
495498///
496- /// fn shr(self, Scalar (rhs): Self) -> Scalar {
497- /// let Scalar (lhs) = self;
498- /// Scalar (lhs >> rhs)
499+ /// fn shr(self, Self (rhs): Self) -> Self::Output {
500+ /// let Self (lhs) = self;
501+ /// Self (lhs >> rhs)
499502/// }
500503/// }
501504///
@@ -518,10 +521,10 @@ shl_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 isize i128 }
518521/// fn shr(self, rhs: usize) -> Self::Output {
519522/// // Rotate the vector by `rhs` places.
520523/// let (a, b) = self.vec.split_at(self.vec.len() - rhs);
521- /// let mut spun_vector: Vec<T> = vec![];
524+ /// let mut spun_vector = vec![];
522525/// spun_vector.extend_from_slice(b);
523526/// spun_vector.extend_from_slice(a);
524- /// SpinVector { vec: spun_vector }
527+ /// Self { vec: spun_vector }
525528/// }
526529/// }
527530///
@@ -606,7 +609,7 @@ shr_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
606609/// impl BitAndAssign for Scalar {
607610/// // rhs is the "right-hand side" of the expression `a &= b`
608611/// fn bitand_assign(&mut self, rhs: Self) {
609- /// *self = Scalar (self.0 & rhs.0)
612+ /// *self = Self (self.0 & rhs.0)
610613/// }
611614/// }
612615///
@@ -640,11 +643,11 @@ shr_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
640643/// // `rhs` is the "right-hand side" of the expression `a &= b`.
641644/// fn bitand_assign(&mut self, rhs: Self) {
642645/// assert_eq!(self.0.len(), rhs.0.len());
643- /// *self = BooleanVector (self.0
644- /// .iter()
645- /// .zip(rhs.0.iter())
646- /// .map(|(x, y)| *x && *y)
647- /// .collect());
646+ /// *self = Self (self.0
647+ /// .iter()
648+ /// .zip(rhs.0.iter())
649+ /// .map(|(x, y)| *x && *y)
650+ /// .collect());
648651/// }
649652/// }
650653///
0 commit comments