@@ -33,9 +33,8 @@ use io;
3333use iterator:: IteratorUtil ;
3434use libc;
3535use libc:: { c_char, c_void, c_int, size_t} ;
36- use libc:: { mode_t , FILE } ;
36+ use libc:: FILE ;
3737use local_data;
38- use option;
3938use option:: { Some , None } ;
4039use os;
4140use prelude:: * ;
@@ -181,7 +180,6 @@ pub fn env() -> ~[(~str,~str)] {
181180 unsafe {
182181 #[ cfg( windows) ]
183182 unsafe fn get_env_pairs ( ) -> ~[ ~str ] {
184- use libc:: types:: os:: arch:: extra:: LPTCH ;
185183 use libc:: funcs:: extra:: kernel32:: {
186184 GetEnvironmentStringsA ,
187185 FreeEnvironmentStringsA
@@ -248,10 +246,10 @@ pub fn getenv(n: &str) -> Option<~str> {
248246 do with_env_lock {
249247 let s = str:: as_c_str ( n, |s| libc:: getenv ( s) ) ;
250248 if ptr:: null :: < u8 > ( ) == cast:: transmute ( s) {
251- option :: None :: < ~str >
249+ None :: < ~str >
252250 } else {
253251 let s = cast:: transmute ( s) ;
254- option :: Some :: < ~str > ( str:: raw:: from_buf ( s) )
252+ Some :: < ~str > ( str:: raw:: from_buf ( s) )
255253 }
256254 }
257255 }
@@ -540,7 +538,7 @@ pub fn homedir() -> Option<Path> {
540538
541539 #[ cfg( windows) ]
542540 fn secondary ( ) -> Option < Path > {
543- do getenv ( ~ "USERPROFILE ") . chain |p| {
541+ do getenv ( "USERPROFILE" ) . chain |p| {
544542 if !p. is_empty ( ) {
545543 Some ( Path ( p) )
546544 } else {
@@ -647,9 +645,7 @@ pub fn make_dir(p: &Path, mode: c_int) -> bool {
647645 use os:: win32:: as_utf16_p;
648646 // FIXME: turn mode into something useful? #2623
649647 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 ) )
653649 != ( 0 as libc:: BOOL )
654650 }
655651 }
@@ -659,7 +655,7 @@ pub fn make_dir(p: &Path, mode: c_int) -> bool {
659655 fn mkdir ( p : & Path , mode : c_int ) -> bool {
660656 unsafe {
661657 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 )
663659 }
664660 }
665661 }
@@ -732,7 +728,6 @@ pub fn list_dir(p: &Path) -> ~[~str] {
732728 }
733729 #[ cfg( windows) ]
734730 unsafe fn get_list ( p : & Path ) -> ~[ ~str ] {
735- use libc:: types:: os:: arch:: extra:: { LPCTSTR , HANDLE , BOOL } ;
736731 use libc:: consts:: os:: extra:: INVALID_HANDLE_VALUE ;
737732 use libc:: wcslen;
738733 use libc:: funcs:: extra:: kernel32:: {
@@ -961,7 +956,7 @@ pub fn copy_file(from: &Path, to: &Path) -> bool {
961956
962957 // Give the new file the old file's permissions
963958 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 )
965960 } != 0 {
966961 return false ; // should be a condition...
967962 }
@@ -1329,7 +1324,7 @@ pub fn glob(pattern: &str) -> ~[Path] {
13291324
13301325/// Returns a vector of Path objects that match the given glob pattern
13311326#[ cfg( target_os = "win32" ) ]
1332- pub fn glob ( pattern : & str ) -> ~[ Path ] {
1327+ pub fn glob ( _pattern : & str ) -> ~[ Path ] {
13331328 fail ! ( "glob() is unimplemented on Windows" )
13341329}
13351330
0 commit comments