diff --git a/storefd-listen/src/lib.rs b/storefd-listen/src/lib.rs index ff3f60d..249d82b 100644 --- a/storefd-listen/src/lib.rs +++ b/storefd-listen/src/lib.rs @@ -230,14 +230,14 @@ impl FileDescriptor { fn from_fd_offset(fd_offset: usize) -> Result { 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( diff --git a/storefd-notify/src/lib.rs b/storefd-notify/src/lib.rs index 57462c2..d9eeae6 100644 --- a/storefd-notify/src/lib.rs +++ b/storefd-notify/src/lib.rs @@ -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,