From: Greg Burri Date: Tue, 13 Dec 2022 15:15:41 +0000 (+0100) Subject: Clean up X-Git-Url: https://git.euphorik.ch/?a=commitdiff_plain;h=bc2b48232da74b4f76db9db07a9eab5c53935d87;p=advent_of_code_2022.git Clean up --- 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::*;