fix clippy warning

This commit is contained in:
fakeshadow 2021-10-17 04:10:15 +08:00
parent a751be73cc
commit 5d3d1fb20e
1 changed files with 11 additions and 13 deletions

View File

@ -92,12 +92,11 @@ fn chunked_read_file_callback(
}
#[cfg(feature = "io-uring")]
fn chunked_read_file_callback(
async fn chunked_read_file_callback(
file: File,
offset: u64,
max_bytes: usize,
) -> impl Future<Output = io::Result<(File, Bytes)>> {
async move {
) -> io::Result<(File, Bytes)> {
let buf = Vec::with_capacity(max_bytes);
let (res, mut buf) = file.read_at(buf, offset).await;
@ -110,7 +109,6 @@ fn chunked_read_file_callback(
let _ = buf.split_off(n_bytes);
Ok((file, Bytes::from(buf)))
}
}
#[cfg(feature = "io-uring")]