mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-03 06:27:45 +00:00
rm: migrate winapi
to windows-sys
crate
This commit is contained in:
parent
c26bf02a04
commit
05a224d40e
3 changed files with 3 additions and 3 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -2800,7 +2800,7 @@ dependencies = [
|
||||||
"remove_dir_all 0.7.0",
|
"remove_dir_all 0.7.0",
|
||||||
"uucore",
|
"uucore",
|
||||||
"walkdir",
|
"walkdir",
|
||||||
"winapi",
|
"windows-sys 0.42.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
@ -21,7 +21,7 @@ remove_dir_all = "0.7.0"
|
||||||
uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["fs"] }
|
uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["fs"] }
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
winapi = { version="0.3", features=[] }
|
windows-sys = { version = "0.42.0", default-features = false, features = ["Win32_Storage_FileSystem"] }
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "rm"
|
name = "rm"
|
||||||
|
|
|
@ -510,7 +510,7 @@ use std::os::windows::prelude::MetadataExt;
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
fn is_symlink_dir(metadata: &fs::Metadata) -> bool {
|
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_type().is_symlink()
|
||||||
&& ((metadata.file_attributes() & FILE_ATTRIBUTE_DIRECTORY) != 0)
|
&& ((metadata.file_attributes() & FILE_ATTRIBUTE_DIRECTORY) != 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue