Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Maaarcocr committed Apr 14, 2023
1 parent 4af3e96 commit e9d60fc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/io/write_fixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::buf::fixed::FixedBuf;
use crate::buf::BoundedBuf;
use crate::io::SharedFd;
use crate::runtime::driver::op::{self, Completable, Op};
use crate::{BufResult, BufError};
use crate::{BufError, BufResult};

use crate::runtime::CONTEXT;
use std::io;
Expand Down
2 changes: 1 addition & 1 deletion src/io/writev.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::BufError;
use crate::runtime::driver::op::{Completable, CqeResult, Op};
use crate::runtime::CONTEXT;
use crate::BufError;
use crate::{buf::BoundedBuf, io::SharedFd, BufResult};
use libc::iovec;
use std::io;
Expand Down
2 changes: 1 addition & 1 deletion src/io/writev_all.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::BufError;
use crate::runtime::driver::op::{Completable, CqeResult, Op};
use crate::runtime::CONTEXT;
use crate::BufError;
use crate::{buf::BoundedBuf, io::SharedFd};
use libc::iovec;
use std::io;
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ impl Builder {
/// ```
pub type BufResult<T, B> = std::result::Result<(T, B), BufError<B>>;


/// A specialized `Error` type for `io-uring` operations with buffers.
#[derive(Debug)]
pub struct BufError<B>(pub std::io::Error, pub B);
Expand Down
8 changes: 6 additions & 2 deletions tests/fixed_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ fn slicing() {
// up to the end of the initialized bytes in the buffer.
let (n, slice) = file
.write_fixed_at(fixed_buf.slice(1..), HELLO.len() as u64)
.await.unwrap();
.await
.unwrap();
assert_eq!(n, 7);
assert_eq!(slice[..], HELLO[4..11]);
let fixed_buf = slice.into_inner();
Expand Down Expand Up @@ -162,7 +163,10 @@ fn pool_next_as_concurrency_limit() {
let file = File::from_std(cloned_file);
let data = [b'0' + i as u8; BUF_SIZE];
buf.put_slice(&data);
let (_, buf) = file.write_fixed_all_at(buf, BUF_SIZE as u64 * i).await.unwrap();
let (_, buf) = file
.write_fixed_all_at(buf, BUF_SIZE as u64 * i)
.await
.unwrap();
println!("[worker {}]: dropping buffer {}", i, buf.buf_index());
});

Expand Down

0 comments on commit e9d60fc

Please sign in to comment.