@@ -33,9 +33,8 @@ use io;
33
33
use iterator:: IteratorUtil ;
34
34
use libc;
35
35
use libc:: { c_char, c_void, c_int, size_t} ;
36
- use libc:: { mode_t , FILE } ;
36
+ use libc:: FILE ;
37
37
use local_data;
38
- use option;
39
38
use option:: { Some , None } ;
40
39
use os;
41
40
use prelude:: * ;
@@ -181,7 +180,6 @@ pub fn env() -> ~[(~str,~str)] {
181
180
unsafe {
182
181
#[ cfg( windows) ]
183
182
unsafe fn get_env_pairs ( ) -> ~[ ~str ] {
184
- use libc:: types:: os:: arch:: extra:: LPTCH ;
185
183
use libc:: funcs:: extra:: kernel32:: {
186
184
GetEnvironmentStringsA ,
187
185
FreeEnvironmentStringsA
@@ -248,10 +246,10 @@ pub fn getenv(n: &str) -> Option<~str> {
248
246
do with_env_lock {
249
247
let s = str:: as_c_str ( n, |s| libc:: getenv ( s) ) ;
250
248
if ptr:: null :: < u8 > ( ) == cast:: transmute ( s) {
251
- option :: None :: < ~str >
249
+ None :: < ~str >
252
250
} else {
253
251
let s = cast:: transmute ( s) ;
254
- option :: Some :: < ~str > ( str:: raw:: from_buf ( s) )
252
+ Some :: < ~str > ( str:: raw:: from_buf ( s) )
255
253
}
256
254
}
257
255
}
@@ -540,7 +538,7 @@ pub fn homedir() -> Option<Path> {
540
538
541
539
#[ cfg( windows) ]
542
540
fn secondary ( ) -> Option < Path > {
543
- do getenv ( ~ "USERPROFILE ") . chain |p| {
541
+ do getenv ( "USERPROFILE" ) . chain |p| {
544
542
if !p. is_empty ( ) {
545
543
Some ( Path ( p) )
546
544
} else {
@@ -647,9 +645,7 @@ pub fn make_dir(p: &Path, mode: c_int) -> bool {
647
645
use os:: win32:: as_utf16_p;
648
646
// FIXME: turn mode into something useful? #2623
649
647
do as_utf16_p( p. to_str ( ) ) |buf| {
650
- libc:: CreateDirectoryW ( buf, unsafe {
651
- cast:: transmute ( 0 )
652
- } )
648
+ libc:: CreateDirectoryW ( buf, cast:: transmute ( 0 ) )
653
649
!= ( 0 as libc:: BOOL )
654
650
}
655
651
}
@@ -659,7 +655,7 @@ pub fn make_dir(p: &Path, mode: c_int) -> bool {
659
655
fn mkdir ( p : & Path , mode : c_int ) -> bool {
660
656
unsafe {
661
657
do as_c_charp ( p. to_str ( ) ) |c| {
662
- libc:: mkdir ( c, mode as mode_t ) == ( 0 as c_int )
658
+ libc:: mkdir ( c, mode as libc :: mode_t ) == ( 0 as c_int )
663
659
}
664
660
}
665
661
}
@@ -732,7 +728,6 @@ pub fn list_dir(p: &Path) -> ~[~str] {
732
728
}
733
729
#[ cfg( windows) ]
734
730
unsafe fn get_list ( p : & Path ) -> ~[ ~str ] {
735
- use libc:: types:: os:: arch:: extra:: { LPCTSTR , HANDLE , BOOL } ;
736
731
use libc:: consts:: os:: extra:: INVALID_HANDLE_VALUE ;
737
732
use libc:: wcslen;
738
733
use libc:: funcs:: extra:: kernel32:: {
@@ -961,7 +956,7 @@ pub fn copy_file(from: &Path, to: &Path) -> bool {
961
956
962
957
// Give the new file the old file's permissions
963
958
if do str:: as_c_str ( to. to_str ( ) ) |to_buf| {
964
- libc:: chmod ( to_buf, from_mode as mode_t )
959
+ libc:: chmod ( to_buf, from_mode as libc :: mode_t )
965
960
} != 0 {
966
961
return false ; // should be a condition...
967
962
}
@@ -1329,7 +1324,7 @@ pub fn glob(pattern: &str) -> ~[Path] {
1329
1324
1330
1325
/// Returns a vector of Path objects that match the given glob pattern
1331
1326
#[ cfg( target_os = "win32" ) ]
1332
- pub fn glob ( pattern : & str ) -> ~[ Path ] {
1327
+ pub fn glob ( _pattern : & str ) -> ~[ Path ] {
1333
1328
fail ! ( "glob() is unimplemented on Windows" )
1334
1329
}
1335
1330
0 commit comments