Skip to content

Commit

Permalink
Respond to @SteveLauC's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers committed Dec 5, 2024
1 parent 181a600 commit 2086102
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/sys/socket/sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ use std::ffi::{OsStr, OsString};
use std::mem::{self, MaybeUninit};
use std::os::unix::ffi::OsStrExt;
#[cfg(linux_android)]
use std::os::unix::io::AsFd;
use std::os::unix::io::AsRawFd;
use std::os::unix::io::{AsFd, AsRawFd};

// Constants
// TCP_CA_NAME_MAX isn't defined in user space include files
Expand Down Expand Up @@ -54,9 +53,9 @@ macro_rules! setsockopt_impl {
fd: &F,
val: &$ty,
) -> $crate::Result<()> {
use std::os::fd::AsRawFd;
use $crate::sys::socket::sockopt::Set;
let setter: $setter =
$crate::sys::socket::sockopt::Set::new(val);
let setter: $setter = Set::new(val);
let level = $level;
let flag = $flag;
let res = unsafe {
Expand Down Expand Up @@ -107,9 +106,9 @@ macro_rules! getsockopt_impl {
&self,
fd: &F,
) -> $crate::Result<$ty> {
use std::os::fd::AsRawFd;
use $crate::sys::socket::sockopt::Get;
let mut getter: $getter =
$crate::sys::socket::sockopt::Get::uninit();
let mut getter: $getter = Get::uninit();
let level = $level;
let flag = $flag;
let res = unsafe {
Expand Down
1 change: 0 additions & 1 deletion test/sys/test_sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,6 @@ mod sockopt_impl {
getsockopt, setsockopt, socket, AddressFamily, SockFlag, SockProtocol,
SockType,
};
use std::os::unix::io::AsRawFd;

sockopt_impl!(
Linger,
Expand Down

0 comments on commit 2086102

Please sign in to comment.