From bd96a9074a399bc0ad93f345b183273d90656b1d Mon Sep 17 00:00:00 2001 From: steven-omaha <35634100+steven-omaha@users.noreply.github.com> Date: Tue, 10 Oct 2023 16:31:29 +0200 Subject: [PATCH] Revert "fix(grouping): non-canonical ordering" This reverts commit 02c44c92d0c6c083adb92ad0e61536d40d7b844e. --- crates/pacdef_core/src/grouping/group.rs | 5 ++++- crates/pacdef_core/src/grouping/section.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/pacdef_core/src/grouping/group.rs b/crates/pacdef_core/src/grouping/group.rs index c8a0d3a..8ea0c7b 100644 --- a/crates/pacdef_core/src/grouping/group.rs +++ b/crates/pacdef_core/src/grouping/group.rs @@ -94,7 +94,10 @@ fn is_child_of_any_dir(path: &Path, dirs: &[PathBuf]) -> bool { impl PartialOrd for Group { fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) + match self.name.partial_cmp(&other.name) { + Some(core::cmp::Ordering::Equal) => None, + ord => ord, + } } } diff --git a/crates/pacdef_core/src/grouping/section.rs b/crates/pacdef_core/src/grouping/section.rs index b79218a..00ad032 100644 --- a/crates/pacdef_core/src/grouping/section.rs +++ b/crates/pacdef_core/src/grouping/section.rs @@ -67,7 +67,7 @@ impl Eq for Section { impl PartialOrd for Section { fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) + self.name.partial_cmp(&other.name) } }