rust/library/core/src/range/legacy.rs
Peter Jaszkowiak ffea65bf61 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()`
2024-07-05 16:33:58 -06:00

10 lines
325 B
Rust

//! # Legacy range types
//!
//! The types within this module will be replaced by the types
//! [`Range`], [`RangeInclusive`], and [`RangeFrom`] in the parent
//! module, [`core::range`].
//!
//! The types here are equivalent to those in [`core::ops`].
#[doc(inline)]
pub use crate::ops::{Range, RangeFrom, RangeInclusive};