From 1b3a49c595cf399ae299fc3c6e5c0bc581f30d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Fri, 29 Apr 2022 13:25:13 +0200 Subject: [PATCH] BackupNamespace: fix deserialize of root NS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler Signed-off-by: Thomas Lamprecht --- pbs-api-types/src/datastore.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs index b75bcf60..5ca102a2 100644 --- a/pbs-api-types/src/datastore.rs +++ b/pbs-api-types/src/datastore.rs @@ -484,6 +484,11 @@ impl BackupNamespace { /// Try to parse a string into a namespace. pub fn new(name: &str) -> Result { let mut this = Self::root(); + + if name.is_empty() { + return Ok(this); + } + for name in name.split('/') { this.push(name.to_string())?; }