]> git.lizzy.rs Git - rust.git/commitdiff
libcore: fix doctests
authorJorge Aparicio <japaricious@gmail.com>
Tue, 2 Dec 2014 00:10:12 +0000 (19:10 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Sun, 14 Dec 2014 01:15:39 +0000 (20:15 -0500)
src/libcore/ops.rs

index d283d70815c33b599e1385e95764d48cd7cfbc1a..7ff5026d0b9c83a5d071ca0dad8dbcc91645c54a 100644 (file)
 //! }
 //!
 //! impl Add<Point, Point> for Point {
-//!     fn add(&self, other: &Point) -> Point {
+//!     fn add(self, other: Point) -> Point {
 //!         Point {x: self.x + other.x, y: self.y + other.y}
 //!     }
 //! }
 //!
 //! impl Sub<Point, Point> for Point {
-//!     fn sub(&self, other: &Point) -> Point {
+//!     fn sub(self, other: Point) -> Point {
 //!         Point {x: self.x - other.x, y: self.y - other.y}
 //!     }
 //! }
@@ -133,9 +133,9 @@ fn add(&self, other: &$t) -> $t { (*self) + (*other) }
 /// struct Foo;
 ///
 /// impl Add<Foo, Foo> for Foo {
-///     fn add(&self, _rhs: &Foo) -> Foo {
+///     fn add(self, _rhs: Foo) -> Foo {
 ///       println!("Adding!");
-///       *self
+///       self
 ///   }
 /// }
 ///
@@ -215,9 +215,9 @@ fn sub(&self, other: &$t) -> $t { (*self) - (*other) }
 /// struct Foo;
 ///
 /// impl Sub<Foo, Foo> for Foo {
-///     fn sub(&self, _rhs: &Foo) -> Foo {
+///     fn sub(self, _rhs: Foo) -> Foo {
 ///         println!("Subtracting!");
-///         *self
+///         self
 ///     }
 /// }
 ///
@@ -297,9 +297,9 @@ fn mul(&self, other: &$t) -> $t { (*self) * (*other) }
 /// struct Foo;
 ///
 /// impl Mul<Foo, Foo> for Foo {
-///     fn mul(&self, _rhs: &Foo) -> Foo {
+///     fn mul(self, _rhs: Foo) -> Foo {
 ///         println!("Multiplying!");
-///         *self
+///         self
 ///     }
 /// }
 ///
@@ -379,9 +379,9 @@ fn div(&self, other: &$t) -> $t { (*self) / (*other) }
 /// struct Foo;
 ///
 /// impl Div<Foo, Foo> for Foo {
-///     fn div(&self, _rhs: &Foo) -> Foo {
+///     fn div(self, _rhs: Foo) -> Foo {
 ///         println!("Dividing!");
-///         *self
+///         self
 ///     }
 /// }
 ///
@@ -475,9 +475,9 @@ fn rem(&self, other: &$t) -> $t {
 /// struct Foo;
 ///
 /// impl Rem<Foo, Foo> for Foo {
-///     fn rem(&self, _rhs: &Foo) -> Foo {
+///     fn rem(self, _rhs: Foo) -> Foo {
 ///         println!("Remainder-ing!");
-///         *self
+///         self
 ///     }
 /// }
 ///
@@ -669,9 +669,9 @@ fn bitand(&self, rhs: &$t) -> $t { (*self) & (*rhs) }
 /// struct Foo;
 ///
 /// impl BitAnd<Foo, Foo> for Foo {
-///     fn bitand(&self, _rhs: &Foo) -> Foo {
+///     fn bitand(self, _rhs: Foo) -> Foo {
 ///         println!("Bitwise And-ing!");
-///         *self
+///         self
 ///     }
 /// }
 ///
@@ -751,9 +751,9 @@ fn bitor(&self, rhs: &$t) -> $t { (*self) | (*rhs) }
 /// struct Foo;
 ///
 /// impl BitOr<Foo, Foo> for Foo {
-///     fn bitor(&self, _rhs: &Foo) -> Foo {
+///     fn bitor(self, _rhs: Foo) -> Foo {
 ///         println!("Bitwise Or-ing!");
-///         *self
+///         self
 ///     }
 /// }
 ///
@@ -833,9 +833,9 @@ fn bitxor(&self, other: &$t) -> $t { (*self) ^ (*other) }
 /// struct Foo;
 ///
 /// impl BitXor<Foo, Foo> for Foo {
-///     fn bitxor(&self, _rhs: &Foo) -> Foo {
+///     fn bitxor(self, _rhs: Foo) -> Foo {
 ///         println!("Bitwise Xor-ing!");
-///         *self
+///         self
 ///     }
 /// }
 ///
@@ -917,9 +917,9 @@ fn shl(&self, other: &uint) -> $t {
 /// struct Foo;
 ///
 /// impl Shl<Foo, Foo> for Foo {
-///     fn shl(&self, _rhs: &Foo) -> Foo {
+///     fn shl(self, _rhs: Foo) -> Foo {
 ///         println!("Shifting left!");
-///         *self
+///         self
 ///     }
 /// }
 ///
@@ -1001,9 +1001,9 @@ fn shr(&self, other: &uint) -> $t { (*self) >> (*other) }
 /// struct Foo;
 ///
 /// impl Shr<Foo, Foo> for Foo {
-///     fn shr(&self, _rhs: &Foo) -> Foo {
+///     fn shr(self, _rhs: Foo) -> Foo {
 ///         println!("Shifting right!");
-///         *self
+///         self
 ///     }
 /// }
 ///