Skip to content

Commit 0c786df

Browse files
committed
unistd: Rework import of std::ptr
1 parent d4e7761 commit 0c786df

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/unistd.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use fcntl::{fcntl, OFlag, O_CLOEXEC, FD_CLOEXEC};
66
use fcntl::FcntlArg::F_SETFD;
77
use 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};
1010
use std::ffi::{CString, CStr, OsString, OsStr};
1111
use std::os::unix::ffi::{OsStringExt, OsStrExt};
1212
use 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

555555
fn 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")))]
10571054
pub 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

Comments
 (0)