Feature gate: #![feature(bound_copied)]
This is a tracking issue to add a Bound::copied method.
Public API
impl<T: Copy> Bound<&T> {
/// Map a `Bound<&T>` to a `Bound<T>` by copying the contents of the bound.
///
/// # Examples
///
/// ```
/// use std::ops::Bound::*;
/// use std::ops::RangeBounds;
///
/// assert_eq!((1..12).start_bound(), Included(&1));
/// assert_eq!((1..12).start_bound().copied(), Included(1));
/// ```
#[must_use = "`self` will be dropped if the result is not used"]
#[unstable(feature = "bound_copied", issue = ???)]
pub fn copied(self) -> Bound<T> {
match self {
Bound::Unbounded => Bound::Unbounded,
Bound::Included(x) => Bound::Included(*x),
Bound::Excluded(x) => Bound::Excluded(*x),
}
}
}
Steps / History
Feature gate:
#![feature(bound_copied)]This is a tracking issue to add a
Bound::copiedmethod.Public API
Steps / History
Bound::copiedlibs-team#637Bound::copied#145968Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩