From 787310df128ae4d740980d90a2349eb46debe48c Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Tue, 13 Dec 2022 16:15:41 +0100 Subject: [PATCH] Clean up --- src/day13.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/day13.rs b/src/day13.rs index 4018d53..cb0b4d9 100644 --- a/src/day13.rs +++ b/src/day13.rs @@ -40,12 +40,6 @@ impl Signal { } } -impl PartialOrd for Signal { - fn partial_cmp(&self, other: &Signal) -> Option { - Some(self.cmp(other)) - } -} - impl Ord for Signal { fn cmp(&self, other: &Signal) -> Ordering { match (self, other) { @@ -67,6 +61,12 @@ impl Ord for Signal { } } +impl PartialOrd for Signal { + fn partial_cmp(&self, other: &Signal) -> Option { + Some(self.cmp(other)) + } +} + pub fn parse(input: &str) -> Vec { input .lines() @@ -95,8 +95,6 @@ pub fn product_indices_special_signals(signals: &[Signal]) -> usize { (signals.binary_search(&s1).unwrap() + 1) * (signals.binary_search(&s2).unwrap() + 1) } -// pub fn sort(signals: &vec[]) - #[cfg(test)] mod tests { use super::*; -- 2.45.2