kvarn_async::prelude::compact_str::core::range

Struct RangeTo

source
pub struct RangeTo<Idx> {
    pub end: Idx,
}
🔬This is a nightly-only experimental API. (new_range_api)
Expand description

A range only bounded exclusively above (..end).

The RangeTo ..end contains all values with x < end. It cannot serve as an Iterator because it doesn’t have a starting point.

§Examples

The ..end syntax is a RangeTo:

assert_eq!((..5), std::ops::RangeTo { end: 5 });

It does not have an IntoIterator implementation, so you can’t use it in a for loop directly. This won’t compile: