Skip to content

Commit e346d32

Browse files
committed
fix Ordering::Equal path
1 parent 41fd824 commit e346d32

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

crates/ide_assists/src/handlers/replace_derive_with_manual_impl.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -723,11 +723,11 @@ struct Foo {
723723
impl PartialOrd for Foo {
724724
$0fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
725725
match self.bin.partial_cmp(&other.bin) {
726-
Some(core::cmp::Ordering::Eq) => {}
726+
Some(core::cmp::Ordering::Equal) => {}
727727
ord => return ord,
728728
}
729729
match self.bar.partial_cmp(&other.bar) {
730-
Some(core::cmp::Ordering::Eq) => {}
730+
Some(core::cmp::Ordering::Equal) => {}
731731
ord => return ord,
732732
}
733733
self.baz.partial_cmp(&other.baz)
@@ -752,11 +752,11 @@ struct Foo(usize, usize, usize);
752752
impl PartialOrd for Foo {
753753
$0fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
754754
match self.0.partial_cmp(&other.0) {
755-
Some(core::cmp::Ordering::Eq) => {}
755+
Some(core::cmp::Ordering::Equal) => {}
756756
ord => return ord,
757757
}
758758
match self.1.partial_cmp(&other.1) {
759-
Some(core::cmp::Ordering::Eq) => {}
759+
Some(core::cmp::Ordering::Equal) => {}
760760
ord => return ord,
761761
}
762762
self.2.partial_cmp(&other.2)

crates/ide_assists/src/utils/gen_trait_fn_body.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ fn gen_partial_ord(adt: &ast::Adt, func: &ast::Fn) -> Option<()> {
578578
let mut arms = vec![];
579579

580580
let variant_name =
581-
make::path_pat(make::ext::path_from_idents(["core", "cmp", "Ordering", "Eq"])?);
581+
make::path_pat(make::ext::path_from_idents(["core", "cmp", "Ordering", "Equal"])?);
582582
let lhs = make::tuple_struct_pat(make::ext::path_from_idents(["Some"])?, [variant_name]);
583583
arms.push(make::match_arm(Some(lhs.into()), None, make::expr_empty_block()));
584584

0 commit comments

Comments
 (0)