diff options
Diffstat (limited to 'src/model/bucket_table.rs')
-rw-r--r-- | src/model/bucket_table.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/model/bucket_table.rs b/src/model/bucket_table.rs index 28234d82..35c0cc27 100644 --- a/src/model/bucket_table.rs +++ b/src/model/bucket_table.rs @@ -75,7 +75,7 @@ impl Entry<EmptyKey, String> for Bucket { } fn merge(&mut self, other: &Self) { - if other.timestamp < self.timestamp { + if other.timestamp > self.timestamp { *self = other.clone(); return; } @@ -104,18 +104,19 @@ impl Entry<EmptyKey, String> for Bucket { pub struct BucketTable; + #[async_trait] impl TableSchema for BucketTable { type P = EmptyKey; type S = String; type E = Bucket; - type Filter = (); + type Filter = DeletedFilter; async fn updated(&self, _old: Option<Self::E>, _new: Option<Self::E>) -> Result<(), Error> { Ok(()) } - fn matches_filter(entry: &Self::E, _filter: &Self::Filter) -> bool { - !entry.deleted + fn matches_filter(entry: &Self::E, filter: &Self::Filter) -> bool { + filter.apply(entry.deleted) } } |