aboutsummaryrefslogtreecommitdiff
path: root/src/model/object_table.rs
diff options
context:
space:
mode:
authorQuentin <quentin@deuxfleurs.fr>2020-11-21 10:52:27 +0100
committerQuentin <quentin@deuxfleurs.fr>2020-11-21 10:52:27 +0100
commit2f6eca4ef36b662be841454774af55fe84f42d6a (patch)
treec6d7b5e5b0bedd66a4c2afacebb32760b5ed924b /src/model/object_table.rs
parent5b363626f4803b3e43cdb450fd6ee04ac9429c4d (diff)
parent5dc304ac41c2ae0699fbdd56117b60c517a1ad39 (diff)
downloadgarage-2f6eca4ef36b662be841454774af55fe84f42d6a.tar.gz
garage-2f6eca4ef36b662be841454774af55fe84f42d6a.zip
Merge remote-tracking branch 'origin/master' into feature/website
Diffstat (limited to 'src/model/object_table.rs')
-rw-r--r--src/model/object_table.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/model/object_table.rs b/src/model/object_table.rs
index 719a222c..929b63f0 100644
--- a/src/model/object_table.rs
+++ b/src/model/object_table.rs
@@ -196,7 +196,7 @@ impl TableSchema for ObjectTable {
type P = String;
type S = String;
type E = Object;
- type Filter = ();
+ type Filter = DeletedFilter;
async fn updated(&self, old: Option<Self::E>, new: Option<Self::E>) -> Result<(), Error> {
let version_table = self.version_table.clone();
@@ -228,8 +228,9 @@ impl TableSchema for ObjectTable {
Ok(())
}
- fn matches_filter(entry: &Self::E, _filter: &Self::Filter) -> bool {
- entry.versions.iter().any(|v| v.is_data())
+ fn matches_filter(entry: &Self::E, filter: &Self::Filter) -> bool {
+ let deleted = !entry.versions.iter().any(|v| v.is_data());
+ filter.apply(deleted)
}
fn try_migrate(bytes: &[u8]) -> Option<Self::E> {