From 2b29716feeac244d91cdc0ca1bc8bcb6c0d97e08 Mon Sep 17 00:00:00 2001 From: 409 <409dev@protonmail.com> Date: Sat, 6 Sep 2025 17:32:19 +0200 Subject: [PATCH] fix fs move issue on lowest directory --- backend/src/lib/outbound/file_system.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/backend/src/lib/outbound/file_system.rs b/backend/src/lib/outbound/file_system.rs index c4a0f59..e9ede83 100644 --- a/backend/src/lib/outbound/file_system.rs +++ b/backend/src/lib/outbound/file_system.rs @@ -336,13 +336,10 @@ impl FileSystem { let name = { let current_path = path.as_str(); - if let Some(last_slash_index) = current_path.rfind("/") - && last_slash_index > 0 - { - ¤t_path[last_slash_index + 1..] - } else { - return Err(io::ErrorKind::AlreadyExists.into()); - } + // This unwrap is safe because an `AbsoluteFilePath` always starts with a slash + let last_slash_index = current_path.rfind("/").unwrap(); + + ¤t_path[last_slash_index + 1..] }; target_path =