Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d8965d3

Browse files
committedJul 5, 2024
add new_range_api for RFC 3550
This includes a `From<legacy::RangeInclusive> for RangeInclusive` impl for convenience, instead of the `TryFrom` impl from the RFC. Having `From` is highly convenient and the assertion is unlikely to be a problem in practice. This includes re-exports of all existing `Range` types under `core::range`, plus the range-related traits (`RangeBounds`, `Step`, `OneSidedRange`) and the `Bound` enum. Currently the iterators are just wrappers around the old range types, and most other trait impls delegate to the old rage types as well. Also includes an `.iter()` shorthand for `.clone().into_iter()`
1 parent 625bcc4 commit d8965d3

File tree

6 files changed

+1163
-2
lines changed

6 files changed

+1163
-2
lines changed
 

‎core/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,8 @@ pub mod panicking;
395395
#[unstable(feature = "core_pattern_types", issue = "none")]
396396
pub mod pat;
397397
pub mod pin;
398+
#[unstable(feature = "new_range_api", issue = "125687")]
399+
pub mod range;
398400
pub mod result;
399401
pub mod sync;
400402

There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.