Tracking Issue for bound_copied (original) (raw)
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 {
match self {
Bound::Unbounded => Bound::Unbounded,
Bound::Included(x) => Bound::Included(*x),
Bound::Excluded(x) => Bound::Excluded(*x),
}
}
}
Steps / History
- ACP: ACP: Add Bound::copied libs-team#637
- Implementation: Add Bound::copied #145968
- Final comment period (FCP)1
- Stabilization PR