diff --git a/src/sys/socket/addr.rs b/src/sys/socket/addr.rs index b4739dd664..71001534a6 100644 --- a/src/sys/socket/addr.rs +++ b/src/sys/socket/addr.rs @@ -812,8 +812,7 @@ pub mod netlink { #[cfg(any(target_os = "ios", target_os = "macos"))] pub mod sys_control { use ::sys::socket::addr::{AddressFamily}; - use libc; - use libc::{c_uchar, uint16_t, uint32_t}; + use libc::{self, c_uchar, uint16_t, uint32_t}; use std::{fmt, mem}; use std::hash::{Hash, Hasher}; use std::os::unix::io::RawFd; diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index 73b5233b8e..86129fcf00 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -5,11 +5,10 @@ use {Error, Errno, Result}; use features; use fcntl::{fcntl, FD_CLOEXEC, O_NONBLOCK}; use fcntl::FcntlArg::{F_SETFD, F_SETFL}; -use libc::{c_void, c_int, socklen_t, size_t, pid_t, uid_t, gid_t}; +use libc::{self, c_void, c_int, socklen_t, size_t, pid_t, uid_t, gid_t}; use std::{mem, ptr, slice}; use std::os::unix::io::RawFd; use sys::uio::IoVec; -use libc; mod addr; mod ffi; diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs index 308a0ed61b..3c13c53968 100644 --- a/src/sys/socket/sockopt.rs +++ b/src/sys/socket/sockopt.rs @@ -1,8 +1,7 @@ use super::{ffi, GetSockOpt, SetSockOpt}; -use libc; use {Errno, Result}; use sys::time::TimeVal; -use libc::{c_int, uint8_t, c_void, socklen_t}; +use libc::{self, c_int, uint8_t, c_void, socklen_t}; use std::mem; use std::os::unix::io::RawFd;