Skip to content

Commit 4d73b2a

Browse files
authored
Fix clippy and rustdoc warnings (#285)
* fix warnings * revert and add clippy allow * another try_from * try again * fix unnecessary try_from
1 parent 74b8435 commit 4d73b2a

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

src/submit.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ impl<'a> Submitter<'a> {
506506
/// except that it completes synchronously.
507507
///
508508
/// Cancellation can target a specific request, or all requests matching some criteria. The
509-
/// [CancelBuilder](types::CancelBuilder) builder supports describing the match criteria for cancellation.
509+
/// [`CancelBuilder`] builder supports describing the match criteria for cancellation.
510510
///
511511
/// An optional `timeout` can be provided to specify how long to wait for matched requests to be
512512
/// canceled. If no timeout is provided, the default is to wait indefinitely.
@@ -540,14 +540,14 @@ impl<'a> Submitter<'a> {
540540
let flags = builder.flags.bits();
541541
let fd = builder.to_fd();
542542

543-
let arg = {
544-
let mut arg = sys::io_uring_sync_cancel_reg::default();
545-
arg.addr = user_data;
546-
arg.fd = fd;
547-
arg.flags = flags;
548-
arg.timeout = timespec;
549-
arg
543+
let arg = sys::io_uring_sync_cancel_reg {
544+
addr: user_data,
545+
fd,
546+
flags,
547+
timeout: timespec,
548+
..Default::default()
550549
};
550+
551551
execute(
552552
self.fd.as_raw_fd(),
553553
sys::IORING_REGISTER_SYNC_CANCEL,

src/sys/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#![allow(
99
clippy::unreadable_literal,
1010
clippy::missing_safety_doc,
11-
clippy::incorrect_clone_impl_on_copy_type
11+
clippy::non_canonical_clone_impl
1212
)]
1313

1414
use std::io;

src/types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ impl<'buf> RecvMsgOut<'buf> {
393393
/// is the same content provided as input to the corresponding SQE
394394
/// (only `msg_namelen` and `msg_controllen` fields are relevant).
395395
#[allow(clippy::result_unit_err)]
396+
#[allow(clippy::useless_conversion)]
396397
pub fn parse(buffer: &'buf [u8], msghdr: &libc::msghdr) -> Result<Self, ()> {
397398
let msghdr_name_len = usize::try_from(msghdr.msg_namelen).unwrap();
398399
let msghdr_control_len = usize::try_from(msghdr.msg_controllen).unwrap();

src/util.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ use std::{io, ptr};
55

66
pub(crate) mod private {
77
/// Private trait that we use as a supertrait of `EntryMarker` to prevent it from being
8-
/// implemented from outside this crate: https://jack.wrenn.fyi/blog/private-trait-methods/
8+
/// implemented from outside this crate.
9+
///
10+
/// See this [blog](https://jack.wrenn.fyi/blog/private-trait-methods/) for more details.
911
pub trait Sealed {}
1012
}
1113

0 commit comments

Comments
 (0)