diff --git a/src/path/path.rs b/src/path/path.rs index 331edfa0a..bb3e922e3 100644 --- a/src/path/path.rs +++ b/src/path/path.rs @@ -1015,9 +1015,9 @@ impl<'a> From<&'a std::path::Path> for &'a Path { } } -impl<'a> Into<&'a std::path::Path> for &'a Path { - fn into(self) -> &'a std::path::Path { - std::path::Path::new(&self.inner) +impl<'a> From<&'a Path> for &'a std::path::Path { + fn from(val: &'a Path) -> Self { + std::path::Path::new(&val.inner) } } diff --git a/src/path/pathbuf.rs b/src/path/pathbuf.rs index f9370cbab..fc1cfbd99 100644 --- a/src/path/pathbuf.rs +++ b/src/path/pathbuf.rs @@ -364,9 +364,9 @@ impl From for PathBuf { } } -impl Into for PathBuf { - fn into(self) -> std::path::PathBuf { - self.inner +impl From for std::path::PathBuf { + fn from(val: PathBuf) -> Self { + val.inner } } diff --git a/src/stream/stream/find.rs b/src/stream/stream/find.rs index 24549e298..7260d7f1d 100644 --- a/src/stream/stream/find.rs +++ b/src/stream/stream/find.rs @@ -19,7 +19,7 @@ impl<'a, S, P> FindFuture<'a, S, P> { impl Unpin for FindFuture<'_, S, P> {} -impl<'a, S, P> Future for FindFuture<'a, S, P> +impl Future for FindFuture<'_, S, P> where S: Stream + Unpin + Sized, P: FnMut(&S::Item) -> bool, diff --git a/src/stream/stream/find_map.rs b/src/stream/stream/find_map.rs index 82beece7f..9cfadb6fe 100644 --- a/src/stream/stream/find_map.rs +++ b/src/stream/stream/find_map.rs @@ -19,7 +19,7 @@ impl<'a, S, F> FindMapFuture<'a, S, F> { impl Unpin for FindMapFuture<'_, S, F> {} -impl<'a, S, B, F> Future for FindMapFuture<'a, S, F> +impl Future for FindMapFuture<'_, S, F> where S: Stream + Unpin + Sized, F: FnMut(S::Item) -> Option, diff --git a/src/stream/stream/nth.rs b/src/stream/stream/nth.rs index 8cdabb6c4..44a681d28 100644 --- a/src/stream/stream/nth.rs +++ b/src/stream/stream/nth.rs @@ -19,7 +19,7 @@ impl<'a, S> NthFuture<'a, S> { } } -impl<'a, S> Future for NthFuture<'a, S> +impl Future for NthFuture<'_, S> where S: Stream + Unpin + Sized, { diff --git a/src/stream/stream/position.rs b/src/stream/stream/position.rs index b730869b6..ae0f42075 100644 --- a/src/stream/stream/position.rs +++ b/src/stream/stream/position.rs @@ -12,7 +12,7 @@ pub struct PositionFuture<'a, S, P> { index: usize, } -impl<'a, S, P> Unpin for PositionFuture<'a, S, P> {} +impl Unpin for PositionFuture<'_, S, P> {} impl<'a, S, P> PositionFuture<'a, S, P> { pub(super) fn new(stream: &'a mut S, predicate: P) -> Self { @@ -24,7 +24,7 @@ impl<'a, S, P> PositionFuture<'a, S, P> { } } -impl<'a, S, P> Future for PositionFuture<'a, S, P> +impl Future for PositionFuture<'_, S, P> where S: Stream + Unpin, P: FnMut(S::Item) -> bool, diff --git a/src/stream/stream/try_fold.rs b/src/stream/stream/try_fold.rs index cbde6efa6..d3b43bfa3 100644 --- a/src/stream/stream/try_fold.rs +++ b/src/stream/stream/try_fold.rs @@ -12,7 +12,7 @@ pub struct TryFoldFuture<'a, S, F, T> { acc: Option, } -impl<'a, S, F, T> Unpin for TryFoldFuture<'a, S, F, T> {} +impl Unpin for TryFoldFuture<'_, S, F, T> {} impl<'a, S, F, T> TryFoldFuture<'a, S, F, T> { pub(super) fn new(stream: &'a mut S, init: T, f: F) -> Self { @@ -24,7 +24,7 @@ impl<'a, S, F, T> TryFoldFuture<'a, S, F, T> { } } -impl<'a, S, F, T, E> Future for TryFoldFuture<'a, S, F, T> +impl Future for TryFoldFuture<'_, S, F, T> where S: Stream + Unpin, F: FnMut(T, S::Item) -> Result, diff --git a/src/stream/stream/try_for_each.rs b/src/stream/stream/try_for_each.rs index c966152bc..ae80aaf19 100644 --- a/src/stream/stream/try_for_each.rs +++ b/src/stream/stream/try_for_each.rs @@ -11,7 +11,7 @@ pub struct TryForEachFuture<'a, S, F> { f: F, } -impl<'a, S, F> Unpin for TryForEachFuture<'a, S, F> {} +impl Unpin for TryForEachFuture<'_, S, F> {} impl<'a, S, F> TryForEachFuture<'a, S, F> { pub(crate) fn new(stream: &'a mut S, f: F) -> Self { @@ -19,7 +19,7 @@ impl<'a, S, F> TryForEachFuture<'a, S, F> { } } -impl<'a, S, F, E> Future for TryForEachFuture<'a, S, F> +impl Future for TryForEachFuture<'_, S, F> where S: Stream + Unpin, F: FnMut(S::Item) -> Result<(), E>, diff --git a/tests/channel.rs b/tests/channel.rs index 2aa271319..5ec31203b 100644 --- a/tests/channel.rs +++ b/tests/channel.rs @@ -59,38 +59,38 @@ fn len_empty_full() { let (s, r) = channel(2); assert_eq!(s.len(), 0); - assert_eq!(s.is_empty(), true); - assert_eq!(s.is_full(), false); + assert!(s.is_empty()); + assert!(!s.is_full()); assert_eq!(r.len(), 0); - assert_eq!(r.is_empty(), true); - assert_eq!(r.is_full(), false); + assert!(r.is_empty()); + assert!(!r.is_full()); s.send(()).await.unwrap(); assert_eq!(s.len(), 1); - assert_eq!(s.is_empty(), false); - assert_eq!(s.is_full(), false); + assert!(!s.is_empty()); + assert!(!s.is_full()); assert_eq!(r.len(), 1); - assert_eq!(r.is_empty(), false); - assert_eq!(r.is_full(), false); + assert!(!r.is_empty()); + assert!(!r.is_full()); s.send(()).await.unwrap(); assert_eq!(s.len(), 2); - assert_eq!(s.is_empty(), false); - assert_eq!(s.is_full(), true); + assert!(!s.is_empty()); + assert!(s.is_full()); assert_eq!(r.len(), 2); - assert_eq!(r.is_empty(), false); - assert_eq!(r.is_full(), true); + assert!(!r.is_empty()); + assert!(r.is_full()); let _ = r.recv().await; assert_eq!(s.len(), 1); - assert_eq!(s.is_empty(), false); - assert_eq!(s.is_full(), false); + assert!(!s.is_empty()); + assert!(!s.is_full()); assert_eq!(r.len(), 1); - assert_eq!(r.is_empty(), false); - assert_eq!(r.is_full(), false); + assert!(!r.is_empty()); + assert!(!r.is_full()); }) }