}
}
-impl PartialOrd for Signal {
- fn partial_cmp(&self, other: &Signal) -> Option<Ordering> {
- Some(self.cmp(other))
- }
-}
-
impl Ord for Signal {
fn cmp(&self, other: &Signal) -> Ordering {
match (self, other) {
}
}
+impl PartialOrd for Signal {
+ fn partial_cmp(&self, other: &Signal) -> Option<Ordering> {
+ Some(self.cmp(other))
+ }
+}
+
pub fn parse(input: &str) -> Vec<Signal> {
input
.lines()
(signals.binary_search(&s1).unwrap() + 1) * (signals.binary_search(&s2).unwrap() + 1)
}
-// pub fn sort(signals: &vec[])
-
#[cfg(test)]
mod tests {
use super::*;