diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2019-03-09 19:10:28 -0800 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2019-03-09 19:10:28 -0800 |
| commit | df4ea90b39c808e858e05f3b4bb05fc29f812d26 (patch) | |
| tree | 933b8174b4345eef7cd841265db05b552849823b /src/liballoc/vec.rs | |
| parent | 26b4cb48484382032522384318e70ceb0fbc4a41 (diff) | |
| download | rust-df4ea90b39c808e858e05f3b4bb05fc29f812d26.tar.gz rust-df4ea90b39c808e858e05f3b4bb05fc29f812d26.zip | |
Use lifetime contravariance to elide more lifetimes in core+alloc+std
Diffstat (limited to 'src/liballoc/vec.rs')
| -rw-r--r-- | src/liballoc/vec.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index adcd3d84f48..cd62c3e0524 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -2182,25 +2182,25 @@ impl<T> AsMut<[T]> for Vec<T> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T: Clone> From<&'a [T]> for Vec<T> { +impl<T: Clone> From<&[T]> for Vec<T> { #[cfg(not(test))] - fn from(s: &'a [T]) -> Vec<T> { + fn from(s: &[T]) -> Vec<T> { s.to_vec() } #[cfg(test)] - fn from(s: &'a [T]) -> Vec<T> { + fn from(s: &[T]) -> Vec<T> { crate::slice::to_vec(s) } } #[stable(feature = "vec_from_mut", since = "1.19.0")] -impl<'a, T: Clone> From<&'a mut [T]> for Vec<T> { +impl<T: Clone> From<&mut [T]> for Vec<T> { #[cfg(not(test))] - fn from(s: &'a mut [T]) -> Vec<T> { + fn from(s: &mut [T]) -> Vec<T> { s.to_vec() } #[cfg(test)] - fn from(s: &'a mut [T]) -> Vec<T> { + fn from(s: &mut [T]) -> Vec<T> { crate::slice::to_vec(s) } } @@ -2231,8 +2231,8 @@ impl<T> From<Vec<T>> for Box<[T]> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a> From<&'a str> for Vec<u8> { - fn from(s: &'a str) -> Vec<u8> { +impl From<&str> for Vec<u8> { + fn from(s: &str) -> Vec<u8> { From::from(s.as_bytes()) } } |
