@@ -1219,9 +1219,16 @@ impl<T, S: VecStorage<T> + ?Sized> Drop for VecInner<T, S> {
1219
1219
}
1220
1220
1221
1221
#[ cfg( feature = "alloc" ) ]
1222
- impl < ' a , T , const N : usize > TryFrom < alloc:: vec:: Vec < T > > for Vec < T , N > {
1222
+ /// Converts the given `alloc::vec::Vec<T>` into a `Vec<T, N>`.
1223
+ impl < T , const N : usize > TryFrom < alloc:: vec:: Vec < T > > for Vec < T , N > {
1223
1224
type Error = ( ) ;
1224
1225
1226
+ /// Converts the given `alloc::vec::Vec<T>` into a `Vec<T, N>`.
1227
+ ///
1228
+ /// # Errors
1229
+ ///
1230
+ /// Returns `Err` if the length of the `alloc::vec::Vec<T>` is greater than `N`.
1231
+ ///
1225
1232
fn try_from ( alloc_vec : alloc:: vec:: Vec < T > ) -> Result < Self , Self :: Error > {
1226
1233
let mut vec = Vec :: new ( ) ;
1227
1234
@@ -1234,7 +1241,9 @@ impl<'a, T, const N: usize> TryFrom<alloc::vec::Vec<T>> for Vec<T, N> {
1234
1241
}
1235
1242
1236
1243
#[ cfg( feature = "alloc" ) ]
1237
- impl < ' a , T , const N : usize > From < Vec < T , N > > for alloc:: vec:: Vec < T > {
1244
+ /// Converts the given `Vec<T, N>` into an `alloc::vec::Vec<T>`.
1245
+ impl < T , const N : usize > From < Vec < T , N > > for alloc:: vec:: Vec < T > {
1246
+ /// Converts the given `Vec<T, N>` into an `alloc::vec::Vec<T>`.
1238
1247
fn from ( vec : Vec < T , N > ) -> Self {
1239
1248
alloc:: vec:: Vec :: from_iter ( vec. into_iter ( ) )
1240
1249
}
0 commit comments