From 60458e6b2d719278c4fe090cb2759e123a3f86d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20H=C3=B6lting?= <87192362+moritz-hoelting@users.noreply.github.com> Date: Sun, 22 Sep 2024 22:26:48 +0200 Subject: [PATCH] fix error in VFolder::add_existing_folder --- src/virtual_fs.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/virtual_fs.rs b/src/virtual_fs.rs index ca59598..aee8aec 100644 --- a/src/virtual_fs.rs +++ b/src/virtual_fs.rs @@ -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 {