]> git.lizzy.rs Git - rust.git/blobdiff - src/libcore/cmp.rs
Prefer `ClassName` over `Self` in example trait implementations
[rust.git] / src / libcore / cmp.rs
index f23128b336466d97102ea44456a7eb5a1b1ad2f6..5b289fd1e005c406a54b05f7c855e59023920af0 100644 (file)
@@ -78,7 +78,7 @@
 /// }
 ///
 /// impl PartialEq for Book {
-///     fn eq(&self, other: &Self) -> bool {
+///     fn eq(&self, other: &Book) -> bool {
 ///         self.isbn == other.isbn
 ///     }
 /// }
@@ -147,7 +147,7 @@ fn ne(&self, other: &Rhs) -> bool { !self.eq(other) }
 ///     format: BookFormat,
 /// }
 /// impl PartialEq for Book {
-///     fn eq(&self, other: &Self) -> bool {
+///     fn eq(&self, other: &Book) -> bool {
 ///         self.isbn == other.isbn
 ///     }
 /// }
@@ -272,19 +272,19 @@ pub fn reverse(self) -> Ordering {
 /// }
 ///
 /// impl Ord for Person {
-///     fn cmp(&self, other: &Self) -> Ordering {
+///     fn cmp(&self, other: &Person) -> Ordering {
 ///         self.height.cmp(&other.height)
 ///     }
 /// }
 ///
 /// impl PartialOrd for Person {
-///     fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
+///     fn partial_cmp(&self, other: &Person) -> Option<Ordering> {
 ///         Some(self.cmp(other))
 ///     }
 /// }
 ///
 /// impl PartialEq for Person {
-///     fn eq(&self, other: &Self) -> bool {
+///     fn eq(&self, other: &Person) -> bool {
 ///         self.height == other.height
 ///     }
 /// }
@@ -359,7 +359,7 @@ fn partial_cmp(&self, other: &Ordering) -> Option<Ordering> {
 ///
 /// ```
 /// impl PartialOrd for Person {
-///     fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
+///     fn partial_cmp(&self, other: &Person) -> Option<Ordering> {
 ///         Some(self.cmp(other))
 ///     }
 /// }
@@ -379,13 +379,13 @@ fn partial_cmp(&self, other: &Ordering) -> Option<Ordering> {
 /// }
 ///
 /// impl PartialOrd for Person {
-///     fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
+///     fn partial_cmp(&self, other: &Person) -> Option<Ordering> {
 ///         self.height.partial_cmp(&other.height)
 ///     }
 /// }
 ///
 /// impl PartialEq for Person {
-///     fn eq(&self, other: &Self) -> bool {
+///     fn eq(&self, other: &Person) -> bool {
 ///         self.height == other.height
 ///     }
 /// }