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;