|
32 | 32 | //! }
|
33 | 33 | //!
|
34 | 34 | //! impl Add<Point, Point> for Point {
|
35 |
| -//! fn add(&self, other: &Point) -> Point { |
| 35 | +//! fn add(self, other: Point) -> Point { |
36 | 36 | //! Point {x: self.x + other.x, y: self.y + other.y}
|
37 | 37 | //! }
|
38 | 38 | //! }
|
39 | 39 | //!
|
40 | 40 | //! impl Sub<Point, Point> for Point {
|
41 |
| -//! fn sub(&self, other: &Point) -> Point { |
| 41 | +//! fn sub(self, other: Point) -> Point { |
42 | 42 | //! Point {x: self.x - other.x, y: self.y - other.y}
|
43 | 43 | //! }
|
44 | 44 | //! }
|
@@ -133,9 +133,9 @@ macro_rules! add_impl(
|
133 | 133 | /// struct Foo;
|
134 | 134 | ///
|
135 | 135 | /// impl Add<Foo, Foo> for Foo {
|
136 |
| -/// fn add(&self, _rhs: &Foo) -> Foo { |
| 136 | +/// fn add(self, _rhs: Foo) -> Foo { |
137 | 137 | /// println!("Adding!");
|
138 |
| -/// *self |
| 138 | +/// self |
139 | 139 | /// }
|
140 | 140 | /// }
|
141 | 141 | ///
|
@@ -215,9 +215,9 @@ macro_rules! sub_impl(
|
215 | 215 | /// struct Foo;
|
216 | 216 | ///
|
217 | 217 | /// impl Sub<Foo, Foo> for Foo {
|
218 |
| -/// fn sub(&self, _rhs: &Foo) -> Foo { |
| 218 | +/// fn sub(self, _rhs: Foo) -> Foo { |
219 | 219 | /// println!("Subtracting!");
|
220 |
| -/// *self |
| 220 | +/// self |
221 | 221 | /// }
|
222 | 222 | /// }
|
223 | 223 | ///
|
@@ -297,9 +297,9 @@ macro_rules! mul_impl(
|
297 | 297 | /// struct Foo;
|
298 | 298 | ///
|
299 | 299 | /// impl Mul<Foo, Foo> for Foo {
|
300 |
| -/// fn mul(&self, _rhs: &Foo) -> Foo { |
| 300 | +/// fn mul(self, _rhs: Foo) -> Foo { |
301 | 301 | /// println!("Multiplying!");
|
302 |
| -/// *self |
| 302 | +/// self |
303 | 303 | /// }
|
304 | 304 | /// }
|
305 | 305 | ///
|
@@ -379,9 +379,9 @@ macro_rules! div_impl(
|
379 | 379 | /// struct Foo;
|
380 | 380 | ///
|
381 | 381 | /// impl Div<Foo, Foo> for Foo {
|
382 |
| -/// fn div(&self, _rhs: &Foo) -> Foo { |
| 382 | +/// fn div(self, _rhs: Foo) -> Foo { |
383 | 383 | /// println!("Dividing!");
|
384 |
| -/// *self |
| 384 | +/// self |
385 | 385 | /// }
|
386 | 386 | /// }
|
387 | 387 | ///
|
@@ -475,9 +475,9 @@ macro_rules! rem_float_impl(
|
475 | 475 | /// struct Foo;
|
476 | 476 | ///
|
477 | 477 | /// impl Rem<Foo, Foo> for Foo {
|
478 |
| -/// fn rem(&self, _rhs: &Foo) -> Foo { |
| 478 | +/// fn rem(self, _rhs: Foo) -> Foo { |
479 | 479 | /// println!("Remainder-ing!");
|
480 |
| -/// *self |
| 480 | +/// self |
481 | 481 | /// }
|
482 | 482 | /// }
|
483 | 483 | ///
|
@@ -669,9 +669,9 @@ macro_rules! bitand_impl(
|
669 | 669 | /// struct Foo;
|
670 | 670 | ///
|
671 | 671 | /// impl BitAnd<Foo, Foo> for Foo {
|
672 |
| -/// fn bitand(&self, _rhs: &Foo) -> Foo { |
| 672 | +/// fn bitand(self, _rhs: Foo) -> Foo { |
673 | 673 | /// println!("Bitwise And-ing!");
|
674 |
| -/// *self |
| 674 | +/// self |
675 | 675 | /// }
|
676 | 676 | /// }
|
677 | 677 | ///
|
@@ -751,9 +751,9 @@ macro_rules! bitor_impl(
|
751 | 751 | /// struct Foo;
|
752 | 752 | ///
|
753 | 753 | /// impl BitOr<Foo, Foo> for Foo {
|
754 |
| -/// fn bitor(&self, _rhs: &Foo) -> Foo { |
| 754 | +/// fn bitor(self, _rhs: Foo) -> Foo { |
755 | 755 | /// println!("Bitwise Or-ing!");
|
756 |
| -/// *self |
| 756 | +/// self |
757 | 757 | /// }
|
758 | 758 | /// }
|
759 | 759 | ///
|
@@ -833,9 +833,9 @@ macro_rules! bitxor_impl(
|
833 | 833 | /// struct Foo;
|
834 | 834 | ///
|
835 | 835 | /// impl BitXor<Foo, Foo> for Foo {
|
836 |
| -/// fn bitxor(&self, _rhs: &Foo) -> Foo { |
| 836 | +/// fn bitxor(self, _rhs: Foo) -> Foo { |
837 | 837 | /// println!("Bitwise Xor-ing!");
|
838 |
| -/// *self |
| 838 | +/// self |
839 | 839 | /// }
|
840 | 840 | /// }
|
841 | 841 | ///
|
@@ -917,9 +917,9 @@ macro_rules! shl_impl(
|
917 | 917 | /// struct Foo;
|
918 | 918 | ///
|
919 | 919 | /// impl Shl<Foo, Foo> for Foo {
|
920 |
| -/// fn shl(&self, _rhs: &Foo) -> Foo { |
| 920 | +/// fn shl(self, _rhs: Foo) -> Foo { |
921 | 921 | /// println!("Shifting left!");
|
922 |
| -/// *self |
| 922 | +/// self |
923 | 923 | /// }
|
924 | 924 | /// }
|
925 | 925 | ///
|
@@ -1001,9 +1001,9 @@ macro_rules! shr_impl(
|
1001 | 1001 | /// struct Foo;
|
1002 | 1002 | ///
|
1003 | 1003 | /// impl Shr<Foo, Foo> for Foo {
|
1004 |
| -/// fn shr(&self, _rhs: &Foo) -> Foo { |
| 1004 | +/// fn shr(self, _rhs: Foo) -> Foo { |
1005 | 1005 | /// println!("Shifting right!");
|
1006 |
| -/// *self |
| 1006 | +/// self |
1007 | 1007 | /// }
|
1008 | 1008 | /// }
|
1009 | 1009 | ///
|
|
0 commit comments