From e93265ab4e964a56b665db968b02a511cb59e08f Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Tue, 6 Sep 2022 14:18:22 -0400 Subject: [PATCH 1/2] feat: use default not-equal method --- src/attributes/derive.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/attributes/derive.md b/src/attributes/derive.md index b8909ac71..4916b6f44 100644 --- a/src/attributes/derive.md +++ b/src/attributes/derive.md @@ -26,7 +26,7 @@ impl PartialEq for Foo { } fn ne(&self, other: &Foo) -> bool { - self.a != other.a || self.b != other.b + !self.eq(other) } } ``` From ea7ba21c879c5cf58d7a2dffcf74f93a6c0933c4 Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Thu, 8 Sep 2022 20:22:14 -0400 Subject: [PATCH 2/2] feat: do not specify not-equal at all See https://github.com/rust-lang/reference/pull/1264#issuecomment-1239719515 --- src/attributes/derive.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/attributes/derive.md b/src/attributes/derive.md index 4916b6f44..bb5631f7a 100644 --- a/src/attributes/derive.md +++ b/src/attributes/derive.md @@ -24,10 +24,6 @@ impl PartialEq for Foo { fn eq(&self, other: &Foo) -> bool { self.a == other.a && self.b == other.b } - - fn ne(&self, other: &Foo) -> bool { - !self.eq(other) - } } ```