mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-26 22:53:28 +00:00
8f9f3aa04d
Optimize is_sorted for Range and RangeInclusive The [`Step`] trait guarantees that `Range<impl Step>` yields items in sorted order. We can override `Iterator::is_sorted` based on this guarantee, as we already do for `Iterator::min` and `max`. Thank you to ``@fiveseven-lambda`` who pointed this out [on the Rust Users Forum](https://users.rust-lang.org/t/is-sorted-method-in-impl-iterator-for-range/64717). [`Step`]: https://doc.rust-lang.org/stable/std/iter/trait.Step.html |
||
---|---|---|
.. | ||
alloc | ||
backtrace@cc89bb66f9 | ||
core | ||
panic_abort | ||
panic_unwind | ||
proc_macro | ||
profiler_builtins | ||
rtstartup | ||
rustc-std-workspace-alloc | ||
rustc-std-workspace-core | ||
rustc-std-workspace-std | ||
std | ||
stdarch@5fdbc476af | ||
test | ||
unwind |