@@ -254,7 +254,7 @@ mod global_env {
254
254
255
255
#[ cfg( windows) ]
256
256
pub fn getenv ( n : & str ) -> Option < ~str > {
257
- use os:: win32:: * ;
257
+ use os:: win32:: { as_utf16_p , fill_utf16_buf_and_decode } ;
258
258
do as_utf16_p( n) |u| {
259
259
do fill_utf16_buf_and_decode ( ) |buf, sz| {
260
260
libc:: GetEnvironmentVariableW ( u, buf, sz)
@@ -275,7 +275,7 @@ mod global_env {
275
275
276
276
#[ cfg( windows) ]
277
277
pub fn setenv ( n : & str , v : & str ) {
278
- use os:: win32:: * ;
278
+ use os:: win32:: as_utf16_p ;
279
279
do as_utf16_p( n) |nbuf| {
280
280
do as_utf16_p ( v) |vbuf| {
281
281
libc:: SetEnvironmentVariableW ( nbuf, vbuf) ;
@@ -428,7 +428,7 @@ pub fn self_exe_path() -> Option<Path> {
428
428
429
429
#[ cfg( windows) ]
430
430
fn load_self ( ) -> Option < ~str > {
431
- use os:: win32:: * ;
431
+ use os:: win32:: fill_utf16_buf_and_decode ;
432
432
do fill_utf16_buf_and_decode ( ) |buf, sz| {
433
433
libc:: GetModuleFileNameW ( 0 u as libc:: DWORD , buf, sz)
434
434
}
@@ -591,7 +591,7 @@ pub fn make_dir(p: &Path, mode: c_int) -> bool {
591
591
592
592
#[ cfg( windows) ]
593
593
fn mkdir ( p : & Path , _mode : c_int ) -> bool {
594
- use os:: win32:: * ;
594
+ use os:: win32:: as_utf16_p ;
595
595
// FIXME: turn mode into something useful? #2623
596
596
do as_utf16_p( p. to_str ( ) ) |buf| {
597
597
libc:: CreateDirectoryW ( buf, unsafe {
@@ -639,7 +639,7 @@ pub fn remove_dir(p: &Path) -> bool {
639
639
640
640
#[cfg(windows)]
641
641
fn rmdir(p: &Path) -> bool {
642
- use os::win32::* ;
642
+ use os::win32::as_utf16_p ;
643
643
return do as_utf16_p(p.to_str()) |buf| {
644
644
libc::RemoveDirectoryW(buf) != (0 as libc::BOOL)
645
645
};
@@ -658,7 +658,7 @@ pub fn change_dir(p: &Path) -> bool {
658
658
659
659
#[cfg(windows)]
660
660
fn chdir(p: &Path) -> bool {
661
- use os::win32::* ;
661
+ use os::win32::as_utf16_p ;
662
662
return do as_utf16_p(p.to_str()) |buf| {
663
663
libc::SetCurrentDirectoryW(buf) != (0 as libc::BOOL)
664
664
};
@@ -678,7 +678,7 @@ pub fn copy_file(from: &Path, to: &Path) -> bool {
678
678
679
679
#[cfg(windows)]
680
680
fn do_copy_file(from: &Path, to: &Path) -> bool {
681
- use os::win32::* ;
681
+ use os::win32::as_utf16_p ;
682
682
return do as_utf16_p(from.to_str()) |fromp| {
683
683
do as_utf16_p(to.to_str()) |top| {
684
684
libc::CopyFileW(fromp, top, (0 as libc::BOOL)) !=
@@ -738,7 +738,7 @@ pub fn remove_file(p: &Path) -> bool {
738
738
739
739
#[ cfg( windows) ]
740
740
fn unlink ( p : & Path ) -> bool {
741
- use os:: win32:: * ;
741
+ use os:: win32:: as_utf16_p ;
742
742
return do as_utf16_p ( p. to_str ( ) ) |buf| {
743
743
libc:: DeleteFileW ( buf) != ( 0 as libc:: BOOL )
744
744
} ;
0 commit comments