From eac5c14b2a17d4bb614653752a5c85b3f2594ea4 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Tue, 6 Aug 2024 01:51:29 +0900 Subject: [PATCH] Update nix to 0.29, windows-sys to 0.59 --- Cargo.toml | 6 +++--- src/platform/windows/mod.rs | 2 +- tests/main/harness.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 70aaa06..9d7c0b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,13 +15,13 @@ readme = "README.md" rust-version = "1.69.0" [target.'cfg(unix)'.dependencies] -nix = { version = "0.28", default-features = false, features = ["fs", "signal"]} +nix = { version = "0.29", default-features = false, features = ["fs", "signal"]} [target.'cfg(windows)'.dependencies] -windows-sys = { version = "0.52", features = ["Win32_Foundation", "Win32_System_Threading", "Win32_Security", "Win32_System_Console"] } +windows-sys = { version = "0.59", features = ["Win32_Foundation", "Win32_System_Threading", "Win32_Security", "Win32_System_Console"] } [target.'cfg(windows)'.dev-dependencies] -windows-sys = { version = "0.52", features = ["Win32_Storage_FileSystem", "Win32_Foundation", "Win32_System_IO", "Win32_System_Console"] } +windows-sys = { version = "0.59", features = ["Win32_Storage_FileSystem", "Win32_Foundation", "Win32_System_IO", "Win32_System_Console"] } [features] termination = [] diff --git a/src/platform/windows/mod.rs b/src/platform/windows/mod.rs index 5f701f7..187b156 100644 --- a/src/platform/windows/mod.rs +++ b/src/platform/windows/mod.rs @@ -43,7 +43,7 @@ unsafe extern "system" fn os_handler(_: u32) -> BOOL { #[inline] pub unsafe fn init_os_handler(_overwrite: bool) -> Result<(), Error> { SEMAPHORE = CreateSemaphoreA(ptr::null_mut(), 0, MAX_SEM_COUNT, ptr::null()); - if SEMAPHORE == 0 { + if SEMAPHORE.is_null() { return Err(io::Error::last_os_error()); } diff --git a/tests/main/harness.rs b/tests/main/harness.rs index 8ba5efc..24113f8 100644 --- a/tests/main/harness.rs +++ b/tests/main/harness.rs @@ -88,7 +88,7 @@ pub mod platform { fn new() -> io::Result { unsafe { let stdout = GetStdHandle(STD_OUTPUT_HANDLE); - if stdout == 0 || stdout == INVALID_HANDLE_VALUE { + if stdout.is_null() || stdout == INVALID_HANDLE_VALUE { return Err(io::Error::last_os_error()); } @@ -139,7 +139,7 @@ pub mod platform { 0 as HANDLE, ); - if stdout == 0 || stdout == INVALID_HANDLE_VALUE { + if stdout.is_null() || stdout == INVALID_HANDLE_VALUE { Err(io::Error::last_os_error()) } else { Ok(stdout)