Skip to content

Commit 77f1ae2

Browse files
authored
Minor formating cleanups (#1330)
1 parent 109efd0 commit 77f1ae2

32 files changed

Lines changed: 229 additions & 113 deletions

src/backend/libc/net/addr.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ impl SocketAddrUnix {
7979

8080
/// Construct a new unnamed address.
8181
///
82-
/// The kernel will assign an abstract Unix-domain address to the socket when you call
83-
/// [`bind_unix()`][crate::net::bind_unix]. You can inspect the assigned name with
82+
/// The kernel will assign an abstract Unix-domain address to the socket
83+
/// when you call [`bind_unix()`][crate::net::bind_unix]. You can
84+
/// inspect the assigned name with
8485
/// [`getsockname`][crate::net::getsockname].
8586
///
8687
/// # References

src/backend/libc/net/msghdr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
use crate::backend::c;
77

88
use crate::io::{self, IoSlice, IoSliceMut};
9-
use crate::net::SocketAddrBuf;
10-
use crate::net::{addr::SocketAddrArg, RecvAncillaryBuffer, SendAncillaryBuffer};
9+
use crate::net::addr::SocketAddrArg;
10+
use crate::net::{RecvAncillaryBuffer, SendAncillaryBuffer, SocketAddrBuf};
1111

1212
use core::mem::zeroed;
1313

src/backend/libc/net/syscalls.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ use crate::backend::conv::ret_u32;
88
use crate::backend::conv::{borrowed_fd, ret, ret_owned_fd, ret_send_recv, send_recv_len};
99
use crate::fd::{BorrowedFd, OwnedFd};
1010
use crate::io;
11+
use crate::net::addr::SocketAddrArg;
1112
#[cfg(target_os = "linux")]
1213
use crate::net::MMsgHdr;
13-
use crate::net::SocketAddrBuf;
1414
use crate::net::{
15-
addr::SocketAddrArg, AddressFamily, Protocol, Shutdown, SocketAddrAny, SocketFlags, SocketType,
15+
AddressFamily, Protocol, Shutdown, SocketAddrAny, SocketAddrBuf, SocketFlags, SocketType,
1616
};
1717
use crate::utils::as_ptr;
1818
use core::mem::{size_of, MaybeUninit};
@@ -225,7 +225,7 @@ pub(crate) fn sendmsg(
225225
}
226226
}
227227

228-
#[cfg(not(any(windows, target_os = "espidf", target_os = "redox", target_os = "vita",)))]
228+
#[cfg(not(any(windows, target_os = "espidf", target_os = "redox", target_os = "vita")))]
229229
pub(crate) fn sendmsg_addr(
230230
sockfd: BorrowedFd<'_>,
231231
addr: &impl SocketAddrArg,

src/backend/libc/shm/syscalls.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ use crate::backend::c;
44
use crate::backend::conv::{c_str, ret, ret_owned_fd};
55
use crate::fd::OwnedFd;
66
use crate::fs::Mode;
7-
use crate::io;
8-
use crate::shm;
7+
use crate::{io, shm};
98

109
pub(crate) fn shm_open(name: &CStr, oflags: shm::OFlags, mode: Mode) -> io::Result<OwnedFd> {
1110
// On this platforms, `mode_t` is `u16` and can't be passed directly to a

src/backend/linux_raw/net/addr.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ impl SocketAddrUnix {
6767

6868
/// Construct a new unnamed address.
6969
///
70-
/// The kernel will assign an abstract Unix-domain address to the socket when you call
71-
/// [`bind_unix()`][crate::net::bind_unix]. You can inspect the assigned name with
70+
/// The kernel will assign an abstract Unix-domain address to the socket
71+
/// when you call [`bind_unix()`][crate::net::bind_unix]. You can
72+
/// inspect the assigned name with
7273
/// [`getsockname`][crate::net::getsockname].
7374
///
7475
/// # References

src/backend/linux_raw/net/msghdr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
use crate::backend::c;
99

1010
use crate::io::{self, IoSlice, IoSliceMut};
11-
use crate::net::SocketAddrBuf;
12-
use crate::net::{addr::SocketAddrArg, RecvAncillaryBuffer, SendAncillaryBuffer};
11+
use crate::net::addr::SocketAddrArg;
12+
use crate::net::{RecvAncillaryBuffer, SendAncillaryBuffer, SocketAddrBuf};
1313

1414
use core::ptr::null_mut;
1515

src/backend/linux_raw/net/read_sockaddr.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ use crate::net::addr::SocketAddrLen;
88
use crate::net::netlink::SocketAddrNetlink;
99
#[cfg(target_os = "linux")]
1010
use crate::net::xdp::{SockaddrXdpFlags, SocketAddrXdp};
11-
use crate::net::{AddressFamily, SocketAddrAny};
12-
use crate::net::{Ipv4Addr, Ipv6Addr, SocketAddrUnix, SocketAddrV4, SocketAddrV6};
11+
use crate::net::{
12+
AddressFamily, Ipv4Addr, Ipv6Addr, SocketAddrAny, SocketAddrUnix, SocketAddrV4, SocketAddrV6,
13+
};
1314
use core::mem::size_of;
1415
use core::slice;
1516

src/backend/linux_raw/net/sockopt.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,20 @@ use crate::io;
1414
use crate::net::sockopt::Timeout;
1515
#[cfg(target_os = "linux")]
1616
use crate::net::xdp::{XdpMmapOffsets, XdpOptionsFlags, XdpRingOffset, XdpStatistics, XdpUmemReg};
17-
use crate::net::SocketAddrBuf;
1817
use crate::net::{
19-
AddressFamily, Ipv4Addr, Ipv6Addr, Protocol, RawProtocol, SocketAddrV4, SocketAddrV6,
20-
SocketType, UCred,
18+
AddressFamily, Ipv4Addr, Ipv6Addr, Protocol, RawProtocol, SocketAddrBuf, SocketAddrV4,
19+
SocketAddrV6, SocketType, UCred,
2120
};
2221
#[cfg(feature = "alloc")]
2322
use alloc::borrow::ToOwned;
2423
#[cfg(feature = "alloc")]
2524
use alloc::string::String;
2625
use core::mem::MaybeUninit;
2726
use core::time::Duration;
27+
use linux_raw_sys::general::{__kernel_old_timeval, __kernel_sock_timeval};
28+
use linux_raw_sys::net::{IPV6_MTU, IPV6_MULTICAST_IF, IP_MTU, IP_MULTICAST_IF};
2829
#[cfg(target_os = "linux")]
2930
use linux_raw_sys::xdp::{xdp_mmap_offsets, xdp_statistics, xdp_statistics_v1};
30-
use linux_raw_sys::{
31-
general::{__kernel_old_timeval, __kernel_sock_timeval},
32-
net::{IPV6_MTU, IPV6_MULTICAST_IF, IP_MTU, IP_MULTICAST_IF},
33-
};
3431
#[cfg(target_arch = "x86")]
3532
use {
3633
crate::backend::conv::{slice_just_addr, x86_sys},

src/backend/linux_raw/net/syscalls.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ use crate::backend::conv::{
1818
use crate::backend::reg::raw_arg;
1919
use crate::fd::{BorrowedFd, OwnedFd};
2020
use crate::io::{self, IoSlice, IoSliceMut};
21+
use crate::net::addr::SocketAddrArg;
2122
#[cfg(target_os = "linux")]
2223
use crate::net::MMsgHdr;
23-
use crate::net::SocketAddrBuf;
2424
use crate::net::{
25-
addr::SocketAddrArg, AddressFamily, Protocol, RecvAncillaryBuffer, RecvMsg,
26-
SendAncillaryBuffer, Shutdown, SocketAddrAny, SocketFlags, SocketType,
25+
AddressFamily, Protocol, RecvAncillaryBuffer, RecvMsg, SendAncillaryBuffer, Shutdown,
26+
SocketAddrAny, SocketAddrBuf, SocketFlags, SocketType,
2727
};
2828
use core::mem::MaybeUninit;
2929
#[cfg(target_arch = "x86")]

src/backend/linux_raw/process/syscalls.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,16 @@ fn _waitid_pidfd(fd: BorrowedFd<'_>, options: WaitIdOptions) -> io::Result<Optio
404404
/// The caller must ensure that `status` is initialized and that `waitid`
405405
/// returned successfully.
406406
#[inline]
407-
#[rustfmt::skip]
408407
unsafe fn cvt_waitid_status(status: MaybeUninit<c::siginfo_t>) -> Option<WaitIdStatus> {
409408
let status = status.assume_init();
410-
if status.__bindgen_anon_1.__bindgen_anon_1._sifields._sigchld._pid == 0 {
409+
if status
410+
.__bindgen_anon_1
411+
.__bindgen_anon_1
412+
._sifields
413+
._sigchld
414+
._pid
415+
== 0
416+
{
411417
None
412418
} else {
413419
Some(WaitIdStatus(status))

0 commit comments

Comments
 (0)