It returns Option<size>
: https://doc.rust-lang.org/std/iter/trait.Step.html#tymethod.steps_between
And the comment says it uses None
for overflow: https://doc.rust-lang.org/src/core/iter/range.rs.html#29
But it also uses None
for unimplemented https://doc.rust-lang.org/src/core/iter/range.rs.html#155
And as a result, Range
needs to return (0, None)
when it gets None
: https://doc.rust-lang.org/src/core/iter/range.rs.html#235-240
It would be nice to either
Step
is expected to support graph walks, but maybe not harder than PartialOrd
)Option<Option<usize>>
or be more hint-like with (usize, Option<usize>)
cc #42168
schneiderfelipeschneiderfelipe
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4