From 152407f2dbac5a10ea0b0409ce73b52b4c827a3f Mon Sep 17 00:00:00 2001 From: Andreas Jonson Date: Thu, 10 May 2018 11:09:56 +0200 Subject: [PATCH] Depend on only one version of winapi --- Cargo.toml | 3 +-- src/lib.rs | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 863a4dada26..ede5385be6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,5 @@ license = "MIT/Apache-2.0" [target."cfg(windows)".dependencies] scopeguard = "0.3" -winapi = { version = "0.3", features = ["errhandlingapi", "handleapi", "processthreadsapi", "std", "winerror", "winnt"] } -userenv-sys = "0.2.0" +winapi = { version = "0.3", features = ["errhandlingapi", "handleapi", "processthreadsapi", "std", "winerror", "winnt", "userenv"] } diff --git a/src/lib.rs b/src/lib.rs index bdc124b22e1..3880f783772 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,8 +24,6 @@ extern crate scopeguard; #[cfg(windows)] extern crate winapi; -#[cfg(windows)] -extern crate userenv; #[cfg(windows)] use winapi::shared::minwindef::DWORD; @@ -68,7 +66,7 @@ pub fn home_dir() -> Option { #[cfg(windows)] fn home_dir_() -> Option { use std::ptr; - use userenv::GetUserProfileDirectoryW; + use winapi::um::userenv::GetUserProfileDirectoryW; use winapi::shared::winerror::ERROR_INSUFFICIENT_BUFFER; use winapi::um::errhandlingapi::GetLastError; use winapi::um::handleapi::CloseHandle;