Skip to content

Commit e93cf07

Browse files
committed
fix: fixed windows-only functions
1 parent f0fd95c commit e93cf07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/search.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ pub(crate) fn is_hidden(entry: &std::fs::DirEntry) -> bool {
213213
return true;
214214
}
215215
}
216-
if let Some(name) = file_name(entry.path()) {
216+
if let Some(name) = file_name(&entry.path()) {
217217
name.to_str().map(|s| s.starts_with(".")).unwrap_or(false)
218218
} else {
219219
false
@@ -245,6 +245,6 @@ pub(crate) fn file_name<P: AsRef<Path> + ?Sized>(path: &P) -> Option<&std::ffi::
245245
/// If the path terminates in ., .., or consists solely of a root of prefix,
246246
/// file_name will return None.
247247
#[cfg(not(unix))]
248-
pub(crate) fn file_name<'a, P: AsRef<Path> + ?Sized>(path: &'a P) -> Option<&'a OsStr> {
248+
pub(crate) fn file_name<'a, P: AsRef<Path> + ?Sized>(path: &'a P) -> Option<&'a std::ffi::OsStr> {
249249
path.as_ref().file_name()
250250
}

0 commit comments

Comments
 (0)