Skip to content

Commit 9df31b2

Browse files
committed
Simplify the conversion from usize to u64
1 parent 8539a91 commit 9df31b2

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/full.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,7 @@ where
5858
fn size_hint(&self) -> SizeHint {
5959
self.data
6060
.as_ref()
61-
.map(|data| {
62-
u64::try_from(data.remaining())
63-
.map(SizeHint::with_exact)
64-
.unwrap_or_else(|_| {
65-
let mut hint = SizeHint::new();
66-
hint.set_lower(u64::MAX);
67-
hint
68-
})
69-
})
61+
.map(|data| SizeHint::with_exact(u64::try_from(data.remaining()).unwrap()))
7062
.unwrap_or_else(|| SizeHint::with_exact(0))
7163
}
7264
}

0 commit comments

Comments
 (0)