From 4ad1177182dfc67f74072e3170ebbb3d88649bfa Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 17 Jun 2022 08:57:24 -0700 Subject: [PATCH] Port from winapi to windows-sys. walkdir just uses the Windows bindings for one thing, and the change is straightforward. This accompanies https://github.com/BurntSushi/winapi-util/pull/13. --- Cargo.toml | 8 +++++--- src/dent.rs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c71c2fe..26baf22 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,9 +23,11 @@ members = ["walkdir-list"] [dependencies] same-file = "1.0.1" -[target.'cfg(windows)'.dependencies.winapi] -version = "0.3" -features = ["std", "winnt"] +[target.'cfg(windows)'.dependencies.windows-sys] +version = "0.36.0" +features = [ + "Win32_Storage_FileSystem", +] [target.'cfg(windows)'.dependencies.winapi-util] version = "0.1.1" diff --git a/src/dent.rs b/src/dent.rs index a28ed3d..5bb36a7 100644 --- a/src/dent.rs +++ b/src/dent.rs @@ -183,7 +183,7 @@ impl DirEntry { #[cfg(windows)] pub(crate) fn is_dir(&self) -> bool { use std::os::windows::fs::MetadataExt; - use winapi::um::winnt::FILE_ATTRIBUTE_DIRECTORY; + use windows_sys::Win32::Storage::FileSystem::FILE_ATTRIBUTE_DIRECTORY; self.metadata.file_attributes() & FILE_ATTRIBUTE_DIRECTORY != 0 }