chore(clippy)

This commit is contained in:
Mathieu Trossevin 2024-01-11 18:02:41 +01:00
parent 89dda462ff
commit d6bd9242ca
Signed by: mtrossevin
GPG key ID: D1DBB7EA828374E9
2 changed files with 9 additions and 8 deletions

View file

@ -230,14 +230,14 @@ impl FileDescriptor {
fn from_fd_offset(fd_offset: usize) -> Result<Self, DupError> {
SD_LISTEN_FDS_START
.checked_add(fd_offset as RawFd)
.map(|fd| {
// SAFETY: The file descriptor won't be closed by the time we duplicate it.
let fd = unsafe { BorrowedFd::borrow_raw(fd) };
rustix::fs::fcntl_dupfd_cloexec(fd, 0).map_err(DupError::from)
})
.expect("Already checked against overflow.")
.map(Self::from_fd)
.checked_add(fd_offset as RawFd)
.map(|fd| {
// SAFETY: The file descriptor won't be closed by the time we duplicate it.
let fd = unsafe { BorrowedFd::borrow_raw(fd) };
rustix::fs::fcntl_dupfd_cloexec(fd, 0).map_err(DupError::from)
})
.expect("Already checked against overflow.")
.map(Self::from_fd)
}
fn from_fds(

View file

@ -209,6 +209,7 @@ impl Notifier {
/// This is created by [`Notifier::guard`].
///
/// Do note that this guard's [`Drop`] implementation will block for the provided timeout and ignore all errors returned by [`barrier()`](Self::barrier).
#[must_use = "if unused the synchronization will happen immediately"]
pub struct NotifyBarrierGuard<'a> {
notifier: &'a Notifier,
timeout: types::BarrierTimeout,