Skip to content

Commit

Permalink
add new_range_api for RFC 3550
Browse files Browse the repository at this point in the history
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.

remove iter shorthands, TryFrom comments
  • Loading branch information
pitaj committed Jun 12, 2024
1 parent 9a7bf4a commit 4a4e57d
Show file tree
Hide file tree
Showing 8 changed files with 1,193 additions and 5 deletions.
2 changes: 2 additions & 0 deletions library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ pub mod panicking;
#[unstable(feature = "core_pattern_types", issue = "none")]
pub mod pat;
pub mod pin;
#[unstable(feature = "new_range_api", issue = "125687")]
pub mod range;
pub mod result;
pub mod sync;

Expand Down
Loading

0 comments on commit 4a4e57d

Please sign in to comment.