Skip to content

Commit 6e0abae

Browse files
committed
Fix size_hint calculation
1 parent 95fedf4 commit 6e0abae

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tokio/src/fs/read_uring.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ pub(crate) async fn read_uring(path: &Path) -> io::Result<Vec<u8>> {
1919
let file = OpenOptions::new().read(true).open(path).await?;
2020

2121
// TODO: use io uring in the future to obtain metadata
22-
let size_hint: Option<usize> = file
23-
.metadata()
24-
.await
25-
.map(|m| usize::try_from(m.len()).unwrap_or(usize::MAX))
26-
.ok();
22+
let size_hint: Option<usize> = file.metadata().await.map(|m| m.len() as usize).ok();
2723

2824
let fd: OwnedFd = file
2925
.try_into_std()

0 commit comments

Comments
 (0)