[pbs-devel] [PATCH proxmox-backup 2/2] datastore: catalog: added lifetime to find function

Gabriel Goller g.goller at proxmox.com
Mon Sep 18 15:41:09 CEST 2023


Added lifetime to `find` function. We need this lifetime
because of the `impl MatchList` and 'anonymous lifetimes in
`impl Trait` are unstable'.

Signed-off-by: Gabriel Goller <g.goller at proxmox.com>
---
 pbs-datastore/src/catalog.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pbs-datastore/src/catalog.rs b/pbs-datastore/src/catalog.rs
index 86e20c92..eb531837 100644
--- a/pbs-datastore/src/catalog.rs
+++ b/pbs-datastore/src/catalog.rs
@@ -661,11 +661,11 @@ impl<R: Read + Seek> CatalogReader<R> {
 
     /// Finds all entries matching the given match patterns and calls the
     /// provided callback on them.
-    pub fn find(
+    pub fn find<'a>(
         &mut self,
         parent: &DirEntry,
         file_path: &mut Vec<u8>,
-        match_list: &impl MatchList, //&[MatchEntry],
+        match_list: &'a impl MatchList<'a>, //&[MatchEntry],
         callback: &mut dyn FnMut(&[u8]) -> Result<(), Error>,
     ) -> Result<(), Error> {
         let file_len = file_path.len();
-- 
2.39.2






More information about the pbs-devel mailing list