diff options
author | Alex Auvolat <alex@adnab.me> | 2020-11-20 23:23:55 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-11-20 23:53:54 +0100 |
commit | 4f7f1d1cb3023af30b0741b04c8b9bcd900f5cc7 (patch) | |
tree | 73eced5b6bf338f6a1dae86671fb9ff0065ad232 /src/table | |
parent | 68be5072e5b6cdf0192a3fbc92713047ccf0d372 (diff) | |
download | garage-4f7f1d1cb3023af30b0741b04c8b9bcd900f5cc7.tar.gz garage-4f7f1d1cb3023af30b0741b04c8b9bcd900f5cc7.zip |
less type bounds
Diffstat (limited to 'src/table')
-rw-r--r-- | src/table/crdt.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/table/crdt.rs b/src/table/crdt.rs index 708d47f3..2b903cf0 100644 --- a/src/table/crdt.rs +++ b/src/table/crdt.rs @@ -27,7 +27,7 @@ pub struct LWW<T> { impl<T> LWW<T> where - T: Serialize + for<'de> Deserialize<'de> + Clone + core::fmt::Debug + PartialEq + CRDT, + T: CRDT, { pub fn new(value: T) -> Self { Self { @@ -52,7 +52,7 @@ where impl<T> CRDT for LWW<T> where - T: Serialize + for<'de> Deserialize<'de> + Clone + core::fmt::Debug + PartialEq + CRDT, + T: Clone + CRDT, { fn merge(&mut self, other: &Self) { if other.ts > self.ts { @@ -96,8 +96,8 @@ pub struct LWWMap<K, V> { impl<K, V> LWWMap<K, V> where - K: Serialize + for<'de> Deserialize<'de> + Clone + core::fmt::Debug + PartialEq + Ord, - V: Serialize + for<'de> Deserialize<'de> + Clone + core::fmt::Debug + PartialEq + CRDT, + K: Ord, + V: CRDT, { pub fn new() -> Self { Self { vals: vec![] } @@ -138,8 +138,8 @@ where impl<K, V> CRDT for LWWMap<K, V> where - K: Serialize + for<'de> Deserialize<'de> + Clone + core::fmt::Debug + Ord, - V: Serialize + for<'de> Deserialize<'de> + Clone + core::fmt::Debug + CRDT, + K: Clone + Ord, + V: Clone + CRDT, { fn merge(&mut self, other: &Self) { for (k, ts2, v2) in other.vals.iter() { |