Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
3836293648
3y ago
0 comments
Save
Share
Sometimes, sure. But an overflow doesn't have to be an error, it can be what you're after and you just want to know when it happens.
0 comments
1 comments · 1 top-level
top
newest
oldest
howinteresting
3y ago
Binary search is similar and the return type there is already Result<usize, usize>:
https://doc.rust-lang.org/std/vec/struct.Vec.html#method.bin...
j
/
k
navigate · click thread line to collapse