mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: import error on Windows
This commit is contained in:
parent
bb0b06231c
commit
79ea19da2d
1 changed files with 2 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use std::{borrow::Cow, collections::{HashMap, VecDeque}, ffi::{OsStr, OsString}, fs::Metadata, os::unix::fs::MetadataExt, path::{Path, PathBuf}};
|
||||
use std::{borrow::Cow, collections::{HashMap, VecDeque}, ffi::{OsStr, OsString}, fs::Metadata, path::{Path, PathBuf}};
|
||||
|
||||
use anyhow::{bail, Result};
|
||||
use tokio::{fs, io, select, sync::{mpsc, oneshot}, time};
|
||||
|
|
@ -27,6 +27,7 @@ pub fn ok_or_not_found(result: io::Result<()>) -> io::Result<()> {
|
|||
pub async fn are_paths_equal(old: impl AsRef<Path>, new: impl AsRef<Path>) -> bool {
|
||||
#[cfg(unix)]
|
||||
{
|
||||
use std::os::unix::fs::MetadataExt;
|
||||
match (fs::symlink_metadata(old).await, fs::symlink_metadata(new).await) {
|
||||
(Ok(old), Ok(new)) => old.dev() == new.dev() && old.ino() == new.ino(),
|
||||
_ => false,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue