crdt: Remove redundant `merge` function

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
This commit is contained in:
Alexis Sellier 2022-11-26 17:15:50 +01:00
parent d1360bbec0
commit d18b67ba21
No known key found for this signature in database
2 changed files with 1 additions and 8 deletions

View File

@ -1,6 +1,7 @@
use serde::{Deserialize, Serialize};
use crate::ord::Max;
use crate::Semilattice as _;
/// Lamport clock.
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]

View File

@ -19,14 +19,6 @@ impl<T> Max<T> {
}
}
impl<T: PartialOrd> Max<T> {
pub fn merge(&mut self, other: Self) {
if other.0 > self.0 {
self.0 = other.0;
}
}
}
impl<T: num_traits::SaturatingAdd + num_traits::One> Max<T> {
pub fn incr(&mut self) {
self.0 = self.0.saturating_add(&T::one());