From ff8dbf33229544cb4a8e4091f376a7019b872121 Mon Sep 17 00:00:00 2001 From: Shupeng Xue Date: Sun, 23 Jun 2024 06:01:22 +1000 Subject: [PATCH] FIx unix branch in `are_paths_equal` --- yazi-shared/src/fs/fns.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yazi-shared/src/fs/fns.rs b/yazi-shared/src/fs/fns.rs index c5d757bf..89f3f78f 100644 --- a/yazi-shared/src/fs/fns.rs +++ b/yazi-shared/src/fs/fns.rs @@ -1,8 +1,7 @@ -use std::{borrow::Cow, collections::{HashMap, VecDeque}, ffi::{OsStr, OsString}, fs::Metadata, path::{Path, PathBuf}}; +use std::{borrow::Cow, collections::{HashMap, VecDeque}, ffi::{OsStr, OsString}, fs::Metadata, os::unix::fs::MetadataExt, path::{Path, PathBuf}}; use anyhow::{bail, Result}; use tokio::{fs, io, select, sync::{mpsc, oneshot}, time}; -use winapi_util::{file::information, Handle}; #[inline] pub async fn must_exists(p: impl AsRef) -> bool { fs::symlink_metadata(p).await.is_ok() } @@ -35,6 +34,7 @@ pub async fn are_paths_equal(old: impl AsRef, new: impl AsRef) -> bo } #[cfg(windows)] { + use winapi_util::{file::information, Handle}; match (Handle::from_path_any(old), Handle::from_path_any(new)) { (Ok(old), Ok(new)) => match (information(old), information(new)) { (Ok(old), Ok(new)) => {