26
26
//! [rust-lang/rust#43321]: https://github.com/rust-lang/rust/issues/43321
27
27
28
28
#![ deny( rust_2018_idioms) ]
29
- #![ allow( deprecated) ] // uses std:: env::home_dir when necessary
29
+ #![ allow( deprecated) ] // uses env::home_dir when necessary
30
30
31
31
use std:: env;
32
32
use std:: io;
@@ -68,7 +68,6 @@ pub fn home_dir() -> Option<PathBuf> {
68
68
69
69
#[ cfg( windows) ]
70
70
fn home_dir_ ( ) -> Option < PathBuf > {
71
- use scopeguard;
72
71
use std:: ptr;
73
72
use winapi:: shared:: winerror:: ERROR_INSUFFICIENT_BUFFER ;
74
73
use winapi:: um:: errhandlingapi:: GetLastError ;
@@ -77,7 +76,7 @@ fn home_dir_() -> Option<PathBuf> {
77
76
use winapi:: um:: userenv:: GetUserProfileDirectoryW ;
78
77
use winapi:: um:: winnt:: TOKEN_READ ;
79
78
80
- std :: env:: var_os ( "USERPROFILE" )
79
+ env:: var_os ( "USERPROFILE" )
81
80
. map ( PathBuf :: from)
82
81
. or_else ( || unsafe {
83
82
let me = GetCurrentProcess ( ) ;
@@ -162,7 +161,7 @@ where
162
161
163
162
#[ cfg( any( unix, target_os = "redox" ) ) ]
164
163
fn home_dir_ ( ) -> Option < PathBuf > {
165
- std :: env:: home_dir ( )
164
+ env:: home_dir ( )
166
165
}
167
166
168
167
/// Returns the storage directory used by Cargo, often knowns as
@@ -217,7 +216,7 @@ pub fn cargo_home_with_cwd(cwd: &Path) -> io::Result<PathBuf> {
217
216
let user_home = home_dir. map ( |p| p. join ( ".cargo" ) ) ;
218
217
219
218
// Compatibility with old cargo that used the std definition of home_dir
220
- let compat_home_dir = std :: env:: home_dir ( ) ;
219
+ let compat_home_dir = env:: home_dir ( ) ;
221
220
let compat_user_home = compat_home_dir. map ( |p| p. join ( ".cargo" ) ) ;
222
221
223
222
if let Some ( p) = env_cargo_home {
0 commit comments