Rollup merge of #50574 - s3bk:range_inclusive_into_inner, r=SimonSapin
add fn `into_inner(self) -> (Idx, Idx)` to RangeInclusive (#49022) adds `into_inner(self) -> (Idx, Idx)` to RangeInclusive https://github.com/rust-lang/rust/issues/49022#issuecomment-387645176
This commit is contained in:
commit
445e53e434
1 changed files with 15 additions and 0 deletions
|
|
@ -411,6 +411,21 @@ impl<Idx> RangeInclusive<Idx> {
|
|||
pub fn end(&self) -> &Idx {
|
||||
&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")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue