This commit is contained in:
mbartlett21 2021-11-10 09:05:15 +10:00 committed by GitHub
parent 9de2745c95
commit 8b81937f9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1498,7 +1498,10 @@ impl<T: Clone> Option<&T> {
#[must_use = "`self` will be dropped if the result is not used"]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_option_cloned", issue = "none")]
pub const fn cloned(self) -> Option<T> where T: ~const Clone {
pub const fn cloned(self) -> Option<T>
where
T: ~const Clone,
{
match self {
Some(t) => Some(t.clone()),
None => None,
@ -1522,7 +1525,10 @@ impl<T: Clone> Option<&mut T> {
#[must_use = "`self` will be dropped if the result is not used"]
#[stable(since = "1.26.0", feature = "option_ref_mut_cloned")]
#[rustc_const_unstable(feature = "const_option_cloned", issue = "none")]
pub const fn cloned(self) -> Option<T> where T: ~const Clone {
pub const fn cloned(self) -> Option<T>
where
T: ~const Clone,
{
match self {
Some(t) => Some(t.clone()),
None => None,