@@ -6,7 +6,7 @@ use fcntl::{fcntl, OFlag, O_CLOEXEC, FD_CLOEXEC};
66use fcntl:: FcntlArg :: F_SETFD ;
77use libc:: { self , c_char, c_void, c_int, c_long, c_uint, size_t, pid_t, off_t,
88 uid_t, gid_t, mode_t} ;
9- use std:: { self , fmt, mem} ;
9+ use std:: { fmt, mem, ptr } ;
1010use std:: ffi:: { CString , CStr , OsString , OsStr } ;
1111use std:: os:: unix:: ffi:: { OsStringExt , OsStrExt } ;
1212use std:: os:: unix:: io:: RawFd ;
@@ -553,9 +553,6 @@ pub fn chown<P: ?Sized + NixPath>(path: &P, owner: Option<Uid>, group: Option<Gi
553553}
554554
555555fn to_exec_array ( args : & [ CString ] ) -> Vec < * const c_char > {
556- use std:: ptr;
557- use libc:: c_char;
558-
559556 let mut args_p: Vec < * const c_char > = args. iter ( ) . map ( |s| s. as_ptr ( ) ) . collect ( ) ;
560557 args_p. push ( ptr:: null ( ) ) ;
561558 args_p
@@ -1056,7 +1053,7 @@ pub fn setgid(gid: Gid) -> Result<()> {
10561053#[ cfg( not( any( target_os = "ios" , target_os = "macos" ) ) ) ]
10571054pub fn getgroups ( ) -> Result < Vec < Gid > > {
10581055 // First get the number of groups so we can size our Vec
1059- let ret = unsafe { libc:: getgroups ( 0 , std :: ptr:: null_mut ( ) ) } ;
1056+ let ret = unsafe { libc:: getgroups ( 0 , ptr:: null_mut ( ) ) } ;
10601057
10611058 // Now actually get the groups. We try multiple times in case the number of
10621059 // groups has changed since the first call to getgroups() and the buffer is
0 commit comments