Skip to content

Commit c8b9a48

Browse files
committed
More clipy fixes
1 parent b3a3c5c commit c8b9a48

File tree

9 files changed

+31
-31
lines changed

9 files changed

+31
-31
lines changed

src/path/path.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1015,9 +1015,9 @@ impl<'a> From<&'a std::path::Path> for &'a Path {
10151015
}
10161016
}
10171017

1018-
impl<'a> Into<&'a std::path::Path> for &'a Path {
1019-
fn into(self) -> &'a std::path::Path {
1020-
std::path::Path::new(&self.inner)
1018+
impl<'a> From<&'a Path> for &'a std::path::Path {
1019+
fn from(val: &'a Path) -> Self {
1020+
std::path::Path::new(&val.inner)
10211021
}
10221022
}
10231023

src/path/pathbuf.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,9 @@ impl From<std::path::PathBuf> for PathBuf {
364364
}
365365
}
366366

367-
impl Into<std::path::PathBuf> for PathBuf {
368-
fn into(self) -> std::path::PathBuf {
369-
self.inner
367+
impl From<PathBuf> for std::path::PathBuf {
368+
fn from(val: PathBuf) -> Self {
369+
val.inner
370370
}
371371
}
372372

src/stream/stream/find.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl<'a, S, P> FindFuture<'a, S, P> {
1919

2020
impl<S: Unpin, P> Unpin for FindFuture<'_, S, P> {}
2121

22-
impl<'a, S, P> Future for FindFuture<'a, S, P>
22+
impl<S, P> Future for FindFuture<'_, S, P>
2323
where
2424
S: Stream + Unpin + Sized,
2525
P: FnMut(&S::Item) -> bool,

src/stream/stream/find_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl<'a, S, F> FindMapFuture<'a, S, F> {
1919

2020
impl<S: Unpin, F> Unpin for FindMapFuture<'_, S, F> {}
2121

22-
impl<'a, S, B, F> Future for FindMapFuture<'a, S, F>
22+
impl<S, B, F> Future for FindMapFuture<'_, S, F>
2323
where
2424
S: Stream + Unpin + Sized,
2525
F: FnMut(S::Item) -> Option<B>,

src/stream/stream/nth.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl<'a, S> NthFuture<'a, S> {
1919
}
2020
}
2121

22-
impl<'a, S> Future for NthFuture<'a, S>
22+
impl<S> Future for NthFuture<'_, S>
2323
where
2424
S: Stream + Unpin + Sized,
2525
{

src/stream/stream/position.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct PositionFuture<'a, S, P> {
1212
index: usize,
1313
}
1414

15-
impl<'a, S, P> Unpin for PositionFuture<'a, S, P> {}
15+
impl<S, P> Unpin for PositionFuture<'_, S, P> {}
1616

1717
impl<'a, S, P> PositionFuture<'a, S, P> {
1818
pub(super) fn new(stream: &'a mut S, predicate: P) -> Self {
@@ -24,7 +24,7 @@ impl<'a, S, P> PositionFuture<'a, S, P> {
2424
}
2525
}
2626

27-
impl<'a, S, P> Future for PositionFuture<'a, S, P>
27+
impl<S, P> Future for PositionFuture<'_, S, P>
2828
where
2929
S: Stream + Unpin,
3030
P: FnMut(S::Item) -> bool,

src/stream/stream/try_fold.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct TryFoldFuture<'a, S, F, T> {
1212
acc: Option<T>,
1313
}
1414

15-
impl<'a, S, F, T> Unpin for TryFoldFuture<'a, S, F, T> {}
15+
impl<S, F, T> Unpin for TryFoldFuture<'_, S, F, T> {}
1616

1717
impl<'a, S, F, T> TryFoldFuture<'a, S, F, T> {
1818
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> {
2424
}
2525
}
2626

27-
impl<'a, S, F, T, E> Future for TryFoldFuture<'a, S, F, T>
27+
impl<S, F, T, E> Future for TryFoldFuture<'_, S, F, T>
2828
where
2929
S: Stream + Unpin,
3030
F: FnMut(T, S::Item) -> Result<T, E>,

src/stream/stream/try_for_each.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ pub struct TryForEachFuture<'a, S, F> {
1111
f: F,
1212
}
1313

14-
impl<'a, S, F> Unpin for TryForEachFuture<'a, S, F> {}
14+
impl<S, F> Unpin for TryForEachFuture<'_, S, F> {}
1515

1616
impl<'a, S, F> TryForEachFuture<'a, S, F> {
1717
pub(crate) fn new(stream: &'a mut S, f: F) -> Self {
1818
Self { stream, f }
1919
}
2020
}
2121

22-
impl<'a, S, F, E> Future for TryForEachFuture<'a, S, F>
22+
impl<S, F, E> Future for TryForEachFuture<'_, S, F>
2323
where
2424
S: Stream + Unpin,
2525
F: FnMut(S::Item) -> Result<(), E>,

tests/channel.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -59,38 +59,38 @@ fn len_empty_full() {
5959
let (s, r) = channel(2);
6060

6161
assert_eq!(s.len(), 0);
62-
assert_eq!(s.is_empty(), true);
63-
assert_eq!(s.is_full(), false);
62+
assert!(s.is_empty());
63+
assert!(!s.is_full());
6464
assert_eq!(r.len(), 0);
65-
assert_eq!(r.is_empty(), true);
66-
assert_eq!(r.is_full(), false);
65+
assert!(r.is_empty());
66+
assert!(!r.is_full());
6767

6868
s.send(()).await.unwrap();
6969

7070
assert_eq!(s.len(), 1);
71-
assert_eq!(s.is_empty(), false);
72-
assert_eq!(s.is_full(), false);
71+
assert!(!s.is_empty());
72+
assert!(!s.is_full());
7373
assert_eq!(r.len(), 1);
74-
assert_eq!(r.is_empty(), false);
75-
assert_eq!(r.is_full(), false);
74+
assert!(!r.is_empty());
75+
assert!(!r.is_full());
7676

7777
s.send(()).await.unwrap();
7878

7979
assert_eq!(s.len(), 2);
80-
assert_eq!(s.is_empty(), false);
81-
assert_eq!(s.is_full(), true);
80+
assert!(!s.is_empty());
81+
assert!(s.is_full());
8282
assert_eq!(r.len(), 2);
83-
assert_eq!(r.is_empty(), false);
84-
assert_eq!(r.is_full(), true);
83+
assert!(!r.is_empty());
84+
assert!(r.is_full());
8585

8686
let _ = r.recv().await;
8787

8888
assert_eq!(s.len(), 1);
89-
assert_eq!(s.is_empty(), false);
90-
assert_eq!(s.is_full(), false);
89+
assert!(!s.is_empty());
90+
assert!(!s.is_full());
9191
assert_eq!(r.len(), 1);
92-
assert_eq!(r.is_empty(), false);
93-
assert_eq!(r.is_full(), false);
92+
assert!(!r.is_empty());
93+
assert!(!r.is_full());
9494
})
9595
}
9696

0 commit comments

Comments
 (0)