Skip to content

Commit de5105b

Browse files
authored
Replace winapi with windows-sys in doctest (#21)
1 parent e6ec6e0 commit de5105b

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@ futures-lite = "1.2.0"
2424
[target.'cfg(unix)'.dev-dependencies]
2525
libc = "0.2.78"
2626

27-
[target.'cfg(windows)'.dev-dependencies]
28-
winapi = { version = "0.3.9", features = ["winbase"] }
27+
[target.'cfg(windows)'.dev-dependencies.windows-sys]
28+
version = "0.48"
29+
features = [
30+
"Win32_Storage_FileSystem",
31+
]

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,7 +1744,7 @@ pub mod windows {
17441744
/// let file = OpenOptions::new()
17451745
/// .create(true)
17461746
/// .write(true)
1747-
/// .custom_flags(winapi::um::winbase::FILE_FLAG_DELETE_ON_CLOSE)
1747+
/// .custom_flags(windows_sys::Win32::Storage::FileSystem::FILE_FLAG_DELETE_ON_CLOSE)
17481748
/// .open("foo.txt")
17491749
/// .await?;
17501750
/// # std::io::Result::Ok(()) });
@@ -1778,7 +1778,7 @@ pub mod windows {
17781778
/// let file = OpenOptions::new()
17791779
/// .write(true)
17801780
/// .create(true)
1781-
/// .attributes(winapi::um::winnt::FILE_ATTRIBUTE_HIDDEN)
1781+
/// .attributes(windows_sys::Win32::Storage::FileSystem::FILE_ATTRIBUTE_HIDDEN)
17821782
/// .open("foo.txt")
17831783
/// .await?;
17841784
/// # std::io::Result::Ok(()) });
@@ -1816,7 +1816,7 @@ pub mod windows {
18161816
/// let file = OpenOptions::new()
18171817
/// .write(true)
18181818
/// .create(true)
1819-
/// .security_qos_flags(winapi::um::winbase::SECURITY_IDENTIFICATION)
1819+
/// .security_qos_flags(windows_sys::Win32::Storage::FileSystem::SECURITY_IDENTIFICATION)
18201820
/// .open(r"\\.\pipe\MyPipe")
18211821
/// .await?;
18221822
/// # std::io::Result::Ok(()) });

0 commit comments

Comments
 (0)