Skip to content

Commit

Permalink
fix: fixed windows-only functions
Browse files Browse the repository at this point in the history
  • Loading branch information
LyonSyonII committed Mar 7, 2024
1 parent f0fd95c commit e93cf07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ pub(crate) fn is_hidden(entry: &std::fs::DirEntry) -> bool {
return true;
}
}
if let Some(name) = file_name(entry.path()) {
if let Some(name) = file_name(&entry.path()) {
name.to_str().map(|s| s.starts_with(".")).unwrap_or(false)
} else {
false
Expand Down Expand Up @@ -245,6 +245,6 @@ pub(crate) fn file_name<P: AsRef<Path> + ?Sized>(path: &P) -> Option<&std::ffi::
/// If the path terminates in ., .., or consists solely of a root of prefix,
/// file_name will return None.
#[cfg(not(unix))]
pub(crate) fn file_name<'a, P: AsRef<Path> + ?Sized>(path: &'a P) -> Option<&'a OsStr> {
pub(crate) fn file_name<'a, P: AsRef<Path> + ?Sized>(path: &'a P) -> Option<&'a std::ffi::OsStr> {
path.as_ref().file_name()
}

0 comments on commit e93cf07

Please sign in to comment.