diff options
author | Alan Somers <asomers@gmail.com> | 2021-09-19 08:29:31 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-19 08:29:31 -0600 |
commit | 515e99bcffcf324d03128649f3ee0ca14d67b5b1 (patch) | |
tree | 654a84d639d1feca971396f958f7589fc1fb81bf /src/sys/socket/mod.rs | |
parent | f0d6d0406d8e763619aecac062d1d2b56ca6e7b2 (diff) | |
parent | a09b1c8ac643d448db479a108ac6726307075453 (diff) | |
download | nix-515e99bcffcf324d03128649f3ee0ca14d67b5b1.zip |
Merge pull request #1529 from asomers/clippy-9-2021
Clippy cleanup
Diffstat (limited to 'src/sys/socket/mod.rs')
-rw-r--r-- | src/sys/socket/mod.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index 96328842..97eea3dc 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -2,7 +2,7 @@ //! //! [Further reading](https://man7.org/linux/man-pages/man7/socket.7.html) use cfg_if::cfg_if; -use crate::{Error, Result, errno::Errno}; +use crate::{Result, errno::Errno}; use libc::{self, c_void, c_int, iovec, socklen_t, size_t, CMSG_FIRSTHDR, CMSG_NXTHDR, CMSG_DATA, CMSG_LEN}; use memoffset::offset_of; @@ -311,9 +311,9 @@ cfg_if! { } } - impl Into<libc::ucred> for UnixCredentials { - fn into(self) -> libc::ucred { - self.0 + impl From<UnixCredentials> for libc::ucred { + fn from(uc: UnixCredentials) -> Self { + uc.0 } } } else if #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] { @@ -1300,6 +1300,7 @@ pub struct RecvMmsgData<'a, I> target_os = "freebsd", target_os = "netbsd", ))] +#[allow(clippy::needless_collect)] // Complicated false positive pub fn recvmmsg<'a, I>( fd: RawFd, data: impl std::iter::IntoIterator<Item=&'a mut RecvMmsgData<'a, I>, @@ -1813,7 +1814,7 @@ pub fn sockaddr_storage_to_addr( assert!(len <= mem::size_of::<sockaddr_storage>()); if len < mem::size_of_val(&addr.ss_family) { - return Err(Error::from(Errno::ENOTCONN)); + return Err(Errno::ENOTCONN); } match c_int::from(addr.ss_family) { |