BackupNamespace: fix deserialize of root NS
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
be5b3ebfdd
commit
6dd8a2ced0
|
@ -484,6 +484,11 @@ impl BackupNamespace {
|
||||||
/// Try to parse a string into a namespace.
|
/// Try to parse a string into a namespace.
|
||||||
pub fn new(name: &str) -> Result<Self, Error> {
|
pub fn new(name: &str) -> Result<Self, Error> {
|
||||||
let mut this = Self::root();
|
let mut this = Self::root();
|
||||||
|
|
||||||
|
if name.is_empty() {
|
||||||
|
return Ok(this);
|
||||||
|
}
|
||||||
|
|
||||||
for name in name.split('/') {
|
for name in name.split('/') {
|
||||||
this.push(name.to_string())?;
|
this.push(name.to_string())?;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue