Skip to content

Commit

Permalink
Merge pull request rust-lang#3 from Eijebong/bump
Browse files Browse the repository at this point in the history
Update dependencies and bump version
  • Loading branch information
alexcrichton authored Mar 19, 2018
2 parents c643270 + bfaf1f1 commit d4d9ac8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
8 changes: 3 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
[package]
name = "home"
version = "0.3.0"
version = "0.3.1"
authors = [ "Brian Anderson <andersrb@gmail.com>" ]
description = "Shared definitions of home directories"
documentation = "https://docs.rs/home"
repository = "https://github.com/brson/home"
license = "MIT/Apache-2.0"

[target."cfg(windows)".dependencies]
scopeguard = "0.1.2"
winapi = "0.2.8"
kernel32-sys = "0.2.1"
advapi32-sys = "0.2.0"
scopeguard = "0.3"
winapi = { version = "0.3", features = ["errhandlingapi", "handleapi", "processthreadsapi", "std", "winerror", "winnt"] }
userenv-sys = "0.2.0"

19 changes: 8 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@ extern crate scopeguard;
#[cfg(windows)]
extern crate winapi;
#[cfg(windows)]
extern crate kernel32;
#[cfg(windows)]
extern crate advapi32;
#[cfg(windows)]
extern crate userenv;

#[cfg(windows)]
use winapi::DWORD;
use winapi::shared::minwindef::DWORD;
use std::path::{PathBuf, Path};
use std::io;
use std::env;
Expand Down Expand Up @@ -72,11 +68,12 @@ pub fn home_dir() -> Option<PathBuf> {
#[cfg(windows)]
fn home_dir_() -> Option<PathBuf> {
use std::ptr;
use kernel32::{GetCurrentProcess, GetLastError, CloseHandle};
use advapi32::OpenProcessToken;
use userenv::GetUserProfileDirectoryW;
use winapi::ERROR_INSUFFICIENT_BUFFER;
use winapi::winnt::TOKEN_READ;
use winapi::shared::winerror::ERROR_INSUFFICIENT_BUFFER;
use winapi::um::errhandlingapi::GetLastError;
use winapi::um::handleapi::CloseHandle;
use winapi::um::processthreadsapi::{GetCurrentProcess, OpenProcessToken};
use winapi::um::winnt::TOKEN_READ;
use scopeguard;

::std::env::var_os("USERPROFILE").map(PathBuf::from).or_else(|| unsafe {
Expand Down Expand Up @@ -108,8 +105,8 @@ fn fill_utf16_buf<F1, F2, T>(mut f1: F1, f2: F2) -> io::Result<T>
where F1: FnMut(*mut u16, DWORD) -> DWORD,
F2: FnOnce(&[u16]) -> T
{
use kernel32::{GetLastError, SetLastError};
use winapi::{ERROR_INSUFFICIENT_BUFFER};
use winapi::um::errhandlingapi::{GetLastError, SetLastError};
use winapi::shared::winerror::ERROR_INSUFFICIENT_BUFFER;

// Start off with a stack buf but then spill over to the heap if we end up
// needing more space.
Expand Down

0 comments on commit d4d9ac8

Please sign in to comment.