From 69c370c5ccaae5646cf2380f92d39097c8ca8645 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Thu, 10 Jan 2019 02:19:26 +0100 Subject: [PATCH] src: remove dependency on the 'kernel32' crate --- BUILD.gn | 1 - Cargo.toml | 1 - src/resources.rs | 5 +---- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 8e013a0e8c..e6fb672f4a 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -26,7 +26,6 @@ main_extern = [ "$rust_build:http", "$rust_build:hyper", "$rust_build:hyper_rustls", - "$rust_build:kernel32", "$rust_build:lazy_static", "$rust_build:libc", "$rust_build:log", diff --git a/Cargo.toml b/Cargo.toml index 039d550398..5c86d526cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,6 @@ getopts = "=0.2.18" http = "=0.1.14" hyper = "=0.12.19" hyper-rustls = "=0.15.0" -kernel32-sys = "=0.2.2" lazy_static = "=1.2.0" libc = "=0.2.46" log = "=0.4.6" diff --git a/src/resources.rs b/src/resources.rs index 308fe1251f..7cd70f21b8 100644 --- a/src/resources.rs +++ b/src/resources.rs @@ -54,9 +54,6 @@ use std::os::unix::io::FromRawFd; #[cfg(windows)] use std::os::windows::io::FromRawHandle; -#[cfg(windows)] -extern crate kernel32; - #[cfg(windows)] extern crate winapi; @@ -73,7 +70,7 @@ lazy_static! { let stdout = unsafe { std::fs::File::from_raw_fd(1) }; #[cfg(windows)] let stdout = unsafe { - std::fs::File::from_raw_handle(kernel32::GetStdHandle( + std::fs::File::from_raw_handle(winapi::um::processenv::GetStdHandle( winapi::um::winbase::STD_OUTPUT_HANDLE)) }; tokio::fs::File::from_std(stdout)