modes:pair: implement hashing for pairs

Once again trivial.
This commit is contained in:
2026-04-05 04:41:14 +01:00
committed by oreodave
parent 3168ce1ef0
commit 4b8ac90a1d

View File

@@ -109,6 +109,15 @@ impl PartialOrd for Pair {
} }
} }
use std::hash::{Hash, Hasher};
impl Hash for Pair {
fn hash<H: Hasher>(&self, state: &mut H) {
// Pairs are just tuples lol.
(self.0, self.1).hash(state);
}
}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;