From 4cc4ea64fd0b798a8c03e94e78117b2e9a435781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Thu, 30 Nov 2023 11:50:39 +0100 Subject: [PATCH] sync: fix source store+namespace printing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit previously this would always refer to the "top" namespace of the source, instead of properly iterating over the namespace tree. adapt the trait accordingly, since this was the only call site. this fixes a cosmetic issue only. Signed-off-by: Fabian Grünbichler --- src/server/pull.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/pull.rs b/src/server/pull.rs index 44d428fd..3b71c156 100644 --- a/src/server/pull.rs +++ b/src/server/pull.rs @@ -91,7 +91,7 @@ trait PullSource: Send + Sync { worker: &WorkerTask, ) -> Result, Error>; fn get_ns(&self) -> BackupNamespace; - fn print_store_and_ns(&self) -> String; + fn get_store(&self) -> &str; /// Returns a reader for reading data from a specific backup directory. async fn reader( @@ -229,8 +229,8 @@ impl PullSource for RemoteSource { self.ns.clone() } - fn print_store_and_ns(&self) -> String { - print_store_and_ns(self.repo.store(), &self.ns) + fn get_store(&self) -> &str { + &self.repo.store() } async fn reader( @@ -299,8 +299,8 @@ impl PullSource for LocalSource { self.ns.clone() } - fn print_store_and_ns(&self) -> String { - print_store_and_ns(self.store.name(), &self.ns) + fn get_store(&self) -> &str { + self.store.name() } async fn reader( @@ -1269,7 +1269,7 @@ pub(crate) async fn pull_store( let mut synced_ns = HashSet::with_capacity(namespaces.len()); for namespace in namespaces { - let source_store_ns_str = params.source.print_store_and_ns(); + let source_store_ns_str = print_store_and_ns(params.source.get_store(), &namespace); let target_ns = namespace.map_prefix(¶ms.source.get_ns(), ¶ms.target.ns)?; let target_store_ns_str = print_store_and_ns(params.target.store.name(), &target_ns);