fix error in VFolder::add_existing_folder

This commit is contained in:
Moritz Hölting 2024-09-22 22:26:48 +02:00
parent 4ca0505e35
commit 60458e6b2d
1 changed files with 2 additions and 3 deletions

View File

@ -44,12 +44,11 @@ impl VFolder {
.split_once('/')
.map_or((path, None), |(h, t)| (h, (!t.is_empty()).then_some(t)));
if let Some(tail) = tail {
// if the folder already exists, add the subfolder to it
if let Some(subfolder) = self.get_folder_mut(head) {
subfolder.add_folder(tail);
subfolder.add_existing_folder(tail, folder);
} else {
let mut new_folder = Self::new();
new_folder.add_folder(tail);
new_folder.add_existing_folder(tail, folder);
self.add_existing_folder(head, new_folder);
}
} else {