add fn into_inner(self) -> (Idx, Idx)
to RangeInclusive (#49022)
This commit is contained in:
parent
8ff4b42064
commit
23aa483102
1 changed files with 15 additions and 0 deletions
|
@ -411,6 +411,21 @@ impl<Idx> RangeInclusive<Idx> {
|
||||||
pub fn end(&self) -> &Idx {
|
pub fn end(&self) -> &Idx {
|
||||||
&self.end
|
&self.end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Destructures the RangeInclusive into (lower bound, upper (inclusive) bound).
|
||||||
|
///
|
||||||
|
/// # Examples
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// #![feature(inclusive_range_methods)]
|
||||||
|
///
|
||||||
|
/// assert_eq!((3..=5).into_inner(), (3, 5));
|
||||||
|
/// ```
|
||||||
|
#[unstable(feature = "inclusive_range_methods", issue = "49022")]
|
||||||
|
#[inline]
|
||||||
|
pub fn into_inner(self) -> (Idx, Idx) {
|
||||||
|
(self.start, self.end)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "inclusive_range", since = "1.26.0")]
|
#[stable(feature = "inclusive_range", since = "1.26.0")]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue