From db60e4524a0f76ea4e9455abcf74cb9e6829d59b Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Wed, 19 Mar 2025 18:05:45 +0000 Subject: [PATCH] Fix another translation bug --- src/archive/find.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/archive/find.rs b/src/archive/find.rs index 5f855feb..ec535751 100644 --- a/src/archive/find.rs +++ b/src/archive/find.rs @@ -122,6 +122,10 @@ fn find_associated_archives_with_arbitrary_suffixes( #[cfg(windows)] fn are_file_paths_equivalent(lhs: &Path, rhs: &Path) -> bool { + if lhs == rhs { + return true; + } + // See // Or windows::Win32::Foundation::ERROR_SHARING_VIOLATION in the "windows" crate. const ERROR_SHARING_VIOLATION: i32 = 32; @@ -133,8 +137,7 @@ fn are_file_paths_equivalent(lhs: &Path, rhs: &Path) -> bool { }; let result = match OpenOptions::new().read(true).share_mode(0).open(rhs) { - Ok(f) => { - dbg!(f); + Ok(_) => { false } Err(e) => { @@ -153,6 +156,10 @@ fn are_file_paths_equivalent(lhs: &Path, rhs: &Path) -> bool { #[cfg(not(windows))] fn are_file_paths_equivalent(lhs: &Path, rhs: &Path) -> bool { + if lhs == rhs { + return true; + } + use std::fs::unix::fs::MetadataExt; let lhs_metadata = match lhs.metadata() {