From 05a224d40e9b62ceb278c04ef5ca15b9af537dad Mon Sep 17 00:00:00 2001 From: Niyaz Nigmatullin Date: Wed, 19 Oct 2022 23:14:31 +0300 Subject: [PATCH] rm: migrate `winapi` to `windows-sys` crate --- Cargo.lock | 2 +- src/uu/rm/Cargo.toml | 2 +- src/uu/rm/src/rm.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fde01840b..ff9cd8db8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2800,7 +2800,7 @@ dependencies = [ "remove_dir_all 0.7.0", "uucore", "walkdir", - "winapi", + "windows-sys 0.42.0", ] [[package]] diff --git a/src/uu/rm/Cargo.toml b/src/uu/rm/Cargo.toml index 646e08005..9d372a5f5 100644 --- a/src/uu/rm/Cargo.toml +++ b/src/uu/rm/Cargo.toml @@ -21,7 +21,7 @@ remove_dir_all = "0.7.0" uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["fs"] } [target.'cfg(windows)'.dependencies] -winapi = { version="0.3", features=[] } +windows-sys = { version = "0.42.0", default-features = false, features = ["Win32_Storage_FileSystem"] } [[bin]] name = "rm" diff --git a/src/uu/rm/src/rm.rs b/src/uu/rm/src/rm.rs index 0f080be6c..dcd457aa6 100644 --- a/src/uu/rm/src/rm.rs +++ b/src/uu/rm/src/rm.rs @@ -510,7 +510,7 @@ use std::os::windows::prelude::MetadataExt; #[cfg(windows)] fn is_symlink_dir(metadata: &fs::Metadata) -> bool { - use winapi::um::winnt::FILE_ATTRIBUTE_DIRECTORY; + use windows_sys::Win32::Storage::FileSystem::FILE_ATTRIBUTE_DIRECTORY; metadata.file_type().is_symlink() && ((metadata.file_attributes() & FILE_ATTRIBUTE_DIRECTORY) != 0)