@@ -1537,7 +1537,7 @@ impl<T, E> Result<&T, E> {
1537
1537
}
1538
1538
}
1539
1539
1540
- impl < T : Copy , E > Result < & mut T , E > {
1540
+ impl < T , E > Result < & mut T , E > {
1541
1541
/// Maps a `Result<&mut T, E>` to a `Result<T, E>` by copying the contents of the
1542
1542
/// `Ok` part.
1543
1543
///
@@ -1552,12 +1552,13 @@ impl<T: Copy, E> Result<&mut T, E> {
1552
1552
/// assert_eq!(copied, Ok(12));
1553
1553
/// ```
1554
1554
#[ unstable( feature = "result_copied" , reason = "newly added" , issue = "63168" ) ]
1555
- pub fn copied ( self ) -> Result < T , E > {
1555
+ pub fn copied ( self ) -> Result < T , E >
1556
+ where
1557
+ T : Copy ,
1558
+ {
1556
1559
self . map ( |& mut t| t)
1557
1560
}
1558
- }
1559
1561
1560
- impl < T : Clone , E > Result < & mut T , E > {
1561
1562
/// Maps a `Result<&mut T, E>` to a `Result<T, E>` by cloning the contents of the
1562
1563
/// `Ok` part.
1563
1564
///
@@ -1572,7 +1573,10 @@ impl<T: Clone, E> Result<&mut T, E> {
1572
1573
/// assert_eq!(cloned, Ok(12));
1573
1574
/// ```
1574
1575
#[ unstable( feature = "result_cloned" , reason = "newly added" , issue = "63168" ) ]
1575
- pub fn cloned ( self ) -> Result < T , E > {
1576
+ pub fn cloned ( self ) -> Result < T , E >
1577
+ where
1578
+ T : Clone ,
1579
+ {
1576
1580
self . map ( |t| t. clone ( ) )
1577
1581
}
1578
1582
}
0 commit comments