fix Ordering::Equal path

This commit is contained in:
Yoshua Wuyts 2021-10-18 14:45:24 +02:00
parent 41fd824415
commit e346d32e69
2 changed files with 5 additions and 5 deletions

View File

@ -723,11 +723,11 @@ struct Foo {
impl PartialOrd for Foo {
$0fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
match self.bin.partial_cmp(&other.bin) {
Some(core::cmp::Ordering::Eq) => {}
Some(core::cmp::Ordering::Equal) => {}
ord => return ord,
}
match self.bar.partial_cmp(&other.bar) {
Some(core::cmp::Ordering::Eq) => {}
Some(core::cmp::Ordering::Equal) => {}
ord => return ord,
}
self.baz.partial_cmp(&other.baz)
@ -752,11 +752,11 @@ fn add_custom_impl_partial_ord_tuple_struct() {
impl PartialOrd for Foo {
$0fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
match self.0.partial_cmp(&other.0) {
Some(core::cmp::Ordering::Eq) => {}
Some(core::cmp::Ordering::Equal) => {}
ord => return ord,
}
match self.1.partial_cmp(&other.1) {
Some(core::cmp::Ordering::Eq) => {}
Some(core::cmp::Ordering::Equal) => {}
ord => return ord,
}
self.2.partial_cmp(&other.2)

View File

@ -578,7 +578,7 @@ fn gen_partial_eq_match(match_target: ast::Expr) -> Option<ast::Stmt> {
let mut arms = vec![];
let variant_name =
make::path_pat(make::ext::path_from_idents(["core", "cmp", "Ordering", "Eq"])?);
make::path_pat(make::ext::path_from_idents(["core", "cmp", "Ordering", "Equal"])?);
let lhs = make::tuple_struct_pat(make::ext::path_from_idents(["Some"])?, [variant_name]);
arms.push(make::match_arm(Some(lhs.into()), None, make::expr_empty_block()));