Skip to content

Commit

Permalink
fix some clippy warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Liu Jiang <[email protected]>
  • Loading branch information
jiangliu committed Jan 2, 2021
1 parent 7ec7cd6 commit 153a0eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,10 @@ unsafe impl Send for IoUring {}
unsafe impl Sync for IoUring {}

fn resultify(x: i32) -> io::Result<u32> {
match x >= 0 {
true => Ok(x as u32),
false => Err(io::Error::from_raw_os_error(-x)),
if x >= 0 {
Ok(x as u32)
} else {
Err(io::Error::from_raw_os_error(-x))
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/submission_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ impl<'ring> SubmissionQueue<'ring> {
/// # Ok(())
/// # }
///
pub fn prepare_sqe<'a>(&'a mut self) -> Option<SQE<'a>> {
pub fn prepare_sqe(&mut self) -> Option<SQE> {
unsafe { prepare_sqe(self.ring.as_mut()) }
}

pub fn prepare_sqes<'a>(&'a mut self, count: u32) -> Option<SQEs<'a>> {
pub fn prepare_sqes(&mut self, count: u32) -> Option<SQEs> {
unsafe {
let sq: &mut uring_sys::io_uring_sq = &mut (*self.ring.as_ptr()).sq;
prepare_sqes(sq, count)
Expand Down

0 comments on commit 153a0eb

Please sign in to comment.