diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-02-02 12:48:12 +0100 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-02-02 12:48:12 +0100 |
| commit | 857530cef1f1419e296e5d9ad623b153c06cb3e6 (patch) | |
| tree | de94fc4c80f394a5e12c54aa23d354ec8ae90609 /src/liballoc/vec.rs | |
| parent | 95a95189570001e37712661f46a496cdedce62b3 (diff) | |
| download | rust-857530cef1f1419e296e5d9ad623b153c06cb3e6.tar.gz rust-857530cef1f1419e296e5d9ad623b153c06cb3e6.zip | |
liballoc: fix some idiom lints.
Diffstat (limited to 'src/liballoc/vec.rs')
| -rw-r--r-- | src/liballoc/vec.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index b43ba6cb57c..66a73e75799 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -1122,7 +1122,7 @@ impl<T> Vec<T> { /// assert_eq!(v, &[]); /// ``` #[stable(feature = "drain", since = "1.6.0")] - pub fn drain<R>(&mut self, range: R) -> Drain<T> + pub fn drain<R>(&mut self, range: R) -> Drain<'_, T> where R: RangeBounds<usize> { // Memory safety @@ -1979,7 +1979,7 @@ impl<T> Vec<T> { /// ``` #[inline] #[stable(feature = "vec_splice", since = "1.21.0")] - pub fn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<I::IntoIter> + pub fn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<'_, I::IntoIter> where R: RangeBounds<usize>, I: IntoIterator<Item=T> { Splice { @@ -2034,7 +2034,7 @@ impl<T> Vec<T> { /// assert_eq!(odds, vec![1, 3, 5, 9, 11, 13, 15]); /// ``` #[unstable(feature = "drain_filter", reason = "recently added", issue = "43244")] - pub fn drain_filter<F>(&mut self, filter: F) -> DrainFilter<T, F> + pub fn drain_filter<F>(&mut self, filter: F) -> DrainFilter<'_, T, F> where F: FnMut(&mut T) -> bool, { let old_len = self.len(); @@ -2150,7 +2150,7 @@ impl<T> Default for Vec<T> { #[stable(feature = "rust1", since = "1.0.0")] impl<T: fmt::Debug> fmt::Debug for Vec<T> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fmt::Debug::fmt(&**self, f) } } @@ -2293,7 +2293,7 @@ pub struct IntoIter<T> { #[stable(feature = "vec_intoiter_debug", since = "1.13.0")] impl<T: fmt::Debug> fmt::Debug for IntoIter<T> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_tuple("IntoIter") .field(&self.as_slice()) .finish() @@ -2463,7 +2463,7 @@ pub struct Drain<'a, T: 'a> { #[stable(feature = "collection_debug", since = "1.17.0")] impl<'a, T: 'a + fmt::Debug> fmt::Debug for Drain<'a, T> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_tuple("Drain") .field(&self.iter.as_slice()) .finish() @@ -2652,7 +2652,7 @@ impl<T> Drain<'_, T> { /// An iterator produced by calling `drain_filter` on Vec. #[unstable(feature = "drain_filter", reason = "recently added", issue = "43244")] #[derive(Debug)] -pub struct DrainFilter<'a, T: 'a, F> +pub struct DrainFilter<'a, T, F> where F: FnMut(&mut T) -> bool, { vec: &'a mut Vec<T>, |
