diff options
author | Quentin <quentin@deuxfleurs.fr> | 2020-11-21 10:52:27 +0100 |
---|---|---|
committer | Quentin <quentin@deuxfleurs.fr> | 2020-11-21 10:52:27 +0100 |
commit | 2f6eca4ef36b662be841454774af55fe84f42d6a (patch) | |
tree | c6d7b5e5b0bedd66a4c2afacebb32760b5ed924b /src/model/key_table.rs | |
parent | 5b363626f4803b3e43cdb450fd6ee04ac9429c4d (diff) | |
parent | 5dc304ac41c2ae0699fbdd56117b60c517a1ad39 (diff) | |
download | garage-2f6eca4ef36b662be841454774af55fe84f42d6a.tar.gz garage-2f6eca4ef36b662be841454774af55fe84f42d6a.zip |
Merge remote-tracking branch 'origin/master' into feature/website
Diffstat (limited to 'src/model/key_table.rs')
-rw-r--r-- | src/model/key_table.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/model/key_table.rs b/src/model/key_table.rs index 76d163b5..05b938ce 100644 --- a/src/model/key_table.rs +++ b/src/model/key_table.rs @@ -104,6 +104,11 @@ impl Entry<EmptyKey, String> for Key { } fn merge(&mut self, other: &Self) { + if other.name_timestamp > self.name_timestamp { + self.name_timestamp = other.name_timestamp; + self.name = other.name.clone(); + } + if other.deleted { self.deleted = true; } @@ -111,10 +116,6 @@ impl Entry<EmptyKey, String> for Key { self.authorized_buckets.clear(); return; } - if other.name_timestamp > self.name_timestamp { - self.name_timestamp = other.name_timestamp; - self.name = other.name.clone(); - } for ab in other.authorized_buckets.iter() { match self @@ -142,13 +143,13 @@ impl TableSchema for KeyTable { type P = EmptyKey; type S = String; type E = Key; - 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) } } |