Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc8b9a48

Browse files
committed
More clipy fixes
1 parentb3a3c5c commitc8b9a48

File tree

9 files changed

+31
-31
lines changed

9 files changed

+31
-31
lines changed

‎src/path/path.rs

Lines changed: 3 additions & 3 deletions
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<&'astd::path::Path>for&'aPath{
1019-
fninto(self) ->&'astd::path::Path{
1020-
std::path::Path::new(&self.inner)
1018+
impl<'a>From<&'aPath>for&'astd::path::Path{
1019+
fnfrom(val:&'aPath) ->Self{
1020+
std::path::Path::new(&val.inner)
10211021
}
10221022
}
10231023

‎src/path/pathbuf.rs

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

367-
implInto<std::path::PathBuf>forPathBuf{
368-
fninto(self) ->std::path::PathBuf{
369-
self.inner
367+
implFrom<PathBuf>forstd::path::PathBuf{
368+
fnfrom(val:PathBuf) ->Self{
369+
val.inner
370370
}
371371
}
372372

‎src/stream/stream/find.rs

Lines changed: 1 addition & 1 deletion
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>UnpinforFindFuture<'_,S,P>{}
2121

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

‎src/stream/stream/find_map.rs

Lines changed: 1 addition & 1 deletion
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>UnpinforFindMapFuture<'_,S,F>{}
2121

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

‎src/stream/stream/nth.rs

Lines changed: 1 addition & 1 deletion
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>FutureforNthFuture<'a,S>
22+
impl<S>FutureforNthFuture<'_,S>
2323
where
2424
S:Stream +Unpin +Sized,
2525
{

‎src/stream/stream/position.rs

Lines changed: 2 additions & 2 deletions
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>UnpinforPositionFuture<'a,S,P>{}
15+
impl<S,P>UnpinforPositionFuture<'_,S,P>{}
1616

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

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

‎src/stream/stream/try_fold.rs

Lines changed: 2 additions & 2 deletions
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>UnpinforTryFoldFuture<'a,S,F,T>{}
15+
impl<S,F,T>UnpinforTryFoldFuture<'_,S,F,T>{}
1616

1717
impl<'a,S,F,T>TryFoldFuture<'a,S,F,T>{
1818
pub(super)fnnew(stream:&'amutS,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>FutureforTryFoldFuture<'a,S,F,T>
27+
impl<S,F,T,E>FutureforTryFoldFuture<'_,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

Lines changed: 2 additions & 2 deletions
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>UnpinforTryForEachFuture<'a,S,F>{}
14+
impl<S,F>UnpinforTryForEachFuture<'_,S,F>{}
1515

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

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

‎tests/channel.rs

Lines changed: 16 additions & 16 deletions
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)

[8]ページ先頭

©2009-2025 Movatter.jp