Skip to content

Commit 223fcc3

Browse files
committed
fix code style for stream
1 parent a69b3a8 commit 223fcc3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+86
-63
lines changed

src/stream/stream/all.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ pub struct AllFuture<'a, S, F, T> {
1414
pub(crate) _marker: PhantomData<T>,
1515
}
1616

17+
impl<'a, S, F, T> AllFuture<'a, S, F, T> {
18+
pub(crate) fn new(stream: &'a mut S, f: F) -> Self {
19+
Self {
20+
stream,
21+
f,
22+
result: true, // the default if the empty stream
23+
_marker: PhantomData,
24+
}
25+
}
26+
}
27+
1728
impl<S: Unpin, F, T> Unpin for AllFuture<'_, S, F, T> {}
1829

1930
impl<S, F> Future for AllFuture<'_, S, F, S::Item>

src/stream/stream/any.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ pub struct AnyFuture<'a, S, F, T> {
1414
pub(crate) _marker: PhantomData<T>,
1515
}
1616

17+
impl<'a, S, F, T> AnyFuture<'a, S, F, T> {
18+
pub(crate) fn new(stream: &'a mut S, f: F) -> Self {
19+
Self {
20+
stream,
21+
f,
22+
result: false, // the default if the empty stream
23+
_marker: PhantomData,
24+
}
25+
}
26+
}
27+
1728
impl<S: Unpin, F, T> Unpin for AnyFuture<'_, S, F, T> {}
1829

1930
impl<S, F> Future for AnyFuture<'_, S, F, S::Item>

src/stream/stream/chain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pin_project! {
2525

2626
impl<S: Stream, U: Stream> Chain<S, U> {
2727
pub(super) fn new(first: S, second: U) -> Self {
28-
Chain {
28+
Self {
2929
first: first.fuse(),
3030
second: second.fuse(),
3131
}

src/stream/stream/cmp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pin_project! {
2626

2727
impl<L: Stream, R: Stream> CmpFuture<L, R> {
2828
pub(super) fn new(l: L, r: R) -> Self {
29-
CmpFuture {
29+
Self {
3030
l: l.fuse(),
3131
r: r.fuse(),
3232
l_cache: None,

src/stream/stream/copied.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pin_project! {
1414

1515
impl<S> Copied<S> {
1616
pub(super) fn new(stream: S) -> Self {
17-
Copied { stream }
17+
Self { stream }
1818
}
1919
}
2020

src/stream/stream/count.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pin_project! {
2020

2121
impl<S> CountFuture<S> {
2222
pub(crate) fn new(stream: S) -> Self {
23-
CountFuture { stream, count: 0 }
23+
Self { stream, count: 0 }
2424
}
2525
}
2626

src/stream/stream/cycle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ impl<S> Cycle<S>
1515
where
1616
S: Stream + Clone,
1717
{
18-
pub fn new(source: S) -> Cycle<S> {
19-
Cycle {
18+
pub(crate) fn new(source: S) -> Self {
19+
Self {
2020
orig: source.clone(),
2121
source: ManuallyDrop::new(source),
2222
}

src/stream/stream/enumerate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pin_project! {
1616

1717
impl<S> Enumerate<S> {
1818
pub(super) fn new(stream: S) -> Self {
19-
Enumerate { stream, i: 0 }
19+
Self { stream, i: 0 }
2020
}
2121
}
2222

src/stream/stream/eq.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ where
2626
L::Item: PartialEq<R::Item>,
2727
{
2828
pub(super) fn new(l: L, r: R) -> Self {
29-
EqFuture {
29+
Self {
3030
l: l.fuse(),
3131
r: r.fuse(),
3232
}

src/stream/stream/filter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pin_project! {
2323

2424
impl<S, P> Filter<S, P> {
2525
pub(super) fn new(stream: S, predicate: P) -> Self {
26-
Filter {
26+
Self {
2727
stream,
2828
predicate,
2929
}

0 commit comments

Comments
 (0)