From cd9dcd044b0d47e1dfc0131d5e4e3b47eff668d3 Mon Sep 17 00:00:00 2001 From: Harsh Khandeparkar Date: Wed, 20 Nov 2024 02:43:30 +0530 Subject: [PATCH] fix: canonicalize was giving error --- backend/src/routing/handlers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/routing/handlers.rs b/backend/src/routing/handlers.rs index bf0588f..ab406a2 100644 --- a/backend/src/routing/handlers.rs +++ b/backend/src/routing/handlers.rs @@ -181,7 +181,7 @@ pub async fn edit( let old_filepath = state.env_vars.paths.get_path_from_slug(&old_filelink); let new_filepath = state.env_vars.paths.get_path_from_slug(&new_qp.filelink); - if old_filepath.canonicalize()? != new_filepath.canonicalize()? { + if old_filepath != new_filepath { if let Err(e) = fs::copy(old_filepath, new_filepath).await { tracing::error!("Error copying file: {}", e);