Use Self more in core in doc when possible
This commit is contained in:
parent
b6e72837fd
commit
87a5dec4db
4 changed files with 55 additions and 52 deletions
|
@ -49,18 +49,18 @@
|
|||
//! }
|
||||
//!
|
||||
//! impl Add for Point {
|
||||
//! type Output = Point;
|
||||
//! type Output = Self;
|
||||
//!
|
||||
//! fn add(self, other: Point) -> Point {
|
||||
//! Point {x: self.x + other.x, y: self.y + other.y}
|
||||
//! fn add(self, other: Self) -> Self {
|
||||
//! Self {x: self.x + other.x, y: self.y + other.y}
|
||||
//! }
|
||||
//! }
|
||||
//!
|
||||
//! impl Sub for Point {
|
||||
//! type Output = Point;
|
||||
//! type Output = Self;
|
||||
//!
|
||||
//! fn sub(self, other: Point) -> Point {
|
||||
//! Point {x: self.x - other.x, y: self.y - other.y}
|
||||
//! fn sub(self, other: Self) -> Self {
|
||||
//! Self {x: self.x - other.x, y: self.y - other.y}
|
||||
//! }
|
||||
//! }
|
||||
//!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue