@@ -89,6 +89,8 @@ pub use self::drain::Drain;
89
89
90
90
mod drain;
91
91
92
+ mod cow;
93
+
92
94
/// A contiguous growable array type, written `Vec<T>` but pronounced 'vector'.
93
95
///
94
96
/// # Examples
@@ -3013,41 +3015,6 @@ impl<T, A: Allocator, const N: usize> TryFrom<Vec<T, A>> for [T; N] {
3013
3015
}
3014
3016
}
3015
3017
3016
- ////////////////////////////////////////////////////////////////////////////////
3017
- // Clone-on-write
3018
- ////////////////////////////////////////////////////////////////////////////////
3019
-
3020
- #[ stable( feature = "cow_from_vec" , since = "1.8.0" ) ]
3021
- impl < ' a , T : Clone > From < & ' a [ T ] > for Cow < ' a , [ T ] > {
3022
- fn from ( s : & ' a [ T ] ) -> Cow < ' a , [ T ] > {
3023
- Cow :: Borrowed ( s)
3024
- }
3025
- }
3026
-
3027
- #[ stable( feature = "cow_from_vec" , since = "1.8.0" ) ]
3028
- impl < ' a , T : Clone > From < Vec < T > > for Cow < ' a , [ T ] > {
3029
- fn from ( v : Vec < T > ) -> Cow < ' a , [ T ] > {
3030
- Cow :: Owned ( v)
3031
- }
3032
- }
3033
-
3034
- #[ stable( feature = "cow_from_vec_ref" , since = "1.28.0" ) ]
3035
- impl < ' a , T : Clone > From < & ' a Vec < T > > for Cow < ' a , [ T ] > {
3036
- fn from ( v : & ' a Vec < T > ) -> Cow < ' a , [ T ] > {
3037
- Cow :: Borrowed ( v. as_slice ( ) )
3038
- }
3039
- }
3040
-
3041
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
3042
- impl < ' a , T > FromIterator < T > for Cow < ' a , [ T ] >
3043
- where
3044
- T : Clone ,
3045
- {
3046
- fn from_iter < I : IntoIterator < Item = T > > ( it : I ) -> Cow < ' a , [ T ] > {
3047
- Cow :: Owned ( FromIterator :: from_iter ( it) )
3048
- }
3049
- }
3050
-
3051
3018
////////////////////////////////////////////////////////////////////////////////
3052
3019
// Iterators
3053
3020
////////////////////////////////////////////////////////////////////////////////
0 commit comments