rust/library/core
Eric Huss 8f9f3aa04d
Rollup merge of #89335 - mbrubeck:range-is-sorted, r=cuviper
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
2021-09-29 19:33:42 -07:00
..
benches Use HTTPS links where possible 2021-06-23 16:26:46 -04:00
primitive_docs Add primitive documentation to libcore 2021-09-12 02:23:08 +00:00
src Rollup merge of #89335 - mbrubeck:range-is-sorted, r=cuviper 2021-09-29 19:33:42 -07:00
tests Auto merge of #88999 - Migi:master, r=oli-obk 2021-09-24 15:22:26 +00:00
Cargo.toml rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00