15
15
/// }
16
16
///
17
17
/// impl Not for Answer {
18
- /// type Output = Answer ;
18
+ /// type Output = Self ;
19
19
///
20
20
/// fn not(self) -> Self::Output {
21
21
/// match self {
@@ -85,7 +85,7 @@ not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
85
85
///
86
86
/// // rhs is the "right-hand side" of the expression `a & b`
87
87
/// fn bitand(self, rhs: Self) -> Self::Output {
88
- /// Scalar (self.0 & rhs.0)
88
+ /// Self (self.0 & rhs.0)
89
89
/// }
90
90
/// }
91
91
///
@@ -106,10 +106,13 @@ not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
106
106
/// impl BitAnd for BooleanVector {
107
107
/// type Output = Self;
108
108
///
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;
111
111
/// 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())
113
116
/// }
114
117
/// }
115
118
///
@@ -179,8 +182,8 @@ bitand_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
179
182
/// type Output = Self;
180
183
///
181
184
/// // 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)
184
187
/// }
185
188
/// }
186
189
///
@@ -201,10 +204,10 @@ bitand_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
201
204
/// impl BitOr for BooleanVector {
202
205
/// type Output = Self;
203
206
///
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;
206
209
/// 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())
208
211
/// }
209
212
/// }
210
213
///
@@ -275,7 +278,7 @@ bitor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
275
278
///
276
279
/// // rhs is the "right-hand side" of the expression `a ^ b`
277
280
/// fn bitxor(self, rhs: Self) -> Self::Output {
278
- /// Scalar (self.0 ^ rhs.0)
281
+ /// Self (self.0 ^ rhs.0)
279
282
/// }
280
283
/// }
281
284
///
@@ -296,13 +299,13 @@ bitor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
296
299
/// impl BitXor for BooleanVector {
297
300
/// type Output = Self;
298
301
///
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;
301
304
/// 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())
306
309
/// }
307
310
/// }
308
311
///
@@ -375,9 +378,9 @@ bitxor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
375
378
/// impl Shl<Scalar> for Scalar {
376
379
/// type Output = Self;
377
380
///
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)
381
384
/// }
382
385
/// }
383
386
///
@@ -400,10 +403,10 @@ bitxor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
400
403
/// fn shl(self, rhs: usize) -> Self::Output {
401
404
/// // Rotate the vector by `rhs` places.
402
405
/// let (a, b) = self.vec.split_at(rhs);
403
- /// let mut spun_vector: Vec<T> = vec![];
406
+ /// let mut spun_vector = vec![];
404
407
/// spun_vector.extend_from_slice(b);
405
408
/// spun_vector.extend_from_slice(a);
406
- /// SpinVector { vec: spun_vector }
409
+ /// Self { vec: spun_vector }
407
410
/// }
408
411
/// }
409
412
///
@@ -493,9 +496,9 @@ shl_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 isize i128 }
493
496
/// impl Shr<Scalar> for Scalar {
494
497
/// type Output = Self;
495
498
///
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)
499
502
/// }
500
503
/// }
501
504
///
@@ -518,10 +521,10 @@ shl_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 isize i128 }
518
521
/// fn shr(self, rhs: usize) -> Self::Output {
519
522
/// // Rotate the vector by `rhs` places.
520
523
/// 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![];
522
525
/// spun_vector.extend_from_slice(b);
523
526
/// spun_vector.extend_from_slice(a);
524
- /// SpinVector { vec: spun_vector }
527
+ /// Self { vec: spun_vector }
525
528
/// }
526
529
/// }
527
530
///
@@ -606,7 +609,7 @@ shr_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
606
609
/// impl BitAndAssign for Scalar {
607
610
/// // rhs is the "right-hand side" of the expression `a &= b`
608
611
/// fn bitand_assign(&mut self, rhs: Self) {
609
- /// *self = Scalar (self.0 & rhs.0)
612
+ /// *self = Self (self.0 & rhs.0)
610
613
/// }
611
614
/// }
612
615
///
@@ -640,11 +643,11 @@ shr_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
640
643
/// // `rhs` is the "right-hand side" of the expression `a &= b`.
641
644
/// fn bitand_assign(&mut self, rhs: Self) {
642
645
/// 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());
648
651
/// }
649
652
/// }
650
653
///
0 commit comments