Skip to content

Commit 0c68d49

Browse files
taiki-ecramertj
authored andcommitted
Remove unnecessary pin projection
1 parent 827cfa6 commit 0c68d49

File tree

11 files changed

+12
-12
lines changed

11 files changed

+12
-12
lines changed

futures-util/src/stream/catch_unwind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl<St: Stream + UnwindSafe> Stream for CatchUnwind<St>
3131
mut self: Pin<&mut Self>,
3232
cx: &mut Context<'_>,
3333
) -> Poll<Option<Self::Item>> {
34-
if *self.as_mut().caught_unwind() {
34+
if self.caught_unwind {
3535
Poll::Ready(None)
3636
} else {
3737
let res = catch_unwind(AssertUnwindSafe(|| {

futures-util/src/stream/filter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl<St, Fut, F> Stream for Filter<St, Fut, F>
9999
cx: &mut Context<'_>,
100100
) -> Poll<Option<St::Item>> {
101101
loop {
102-
if self.as_mut().pending_fut().as_pin_mut().is_none() {
102+
if self.pending_fut.is_none() {
103103
let item = match ready!(self.as_mut().stream().poll_next(cx)) {
104104
Some(e) => e,
105105
None => return Poll::Ready(None),

futures-util/src/stream/filter_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl<St, Fut, F, T> Stream for FilterMap<St, Fut, F>
9292
cx: &mut Context<'_>,
9393
) -> Poll<Option<T>> {
9494
loop {
95-
if self.as_mut().pending().as_pin_mut().is_none() {
95+
if self.pending.is_none() {
9696
let item = match ready!(self.as_mut().stream().poll_next(cx)) {
9797
Some(e) => e,
9898
None => return Poll::Ready(None),

futures-util/src/stream/flatten.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl<St> Stream for Flatten<St>
8080
cx: &mut Context<'_>,
8181
) -> Poll<Option<Self::Item>> {
8282
loop {
83-
if self.as_mut().next().as_pin_mut().is_none() {
83+
if self.next.is_none() {
8484
match ready!(self.as_mut().stream().poll_next(cx)) {
8585
Some(e) => self.as_mut().next().set(Some(e)),
8686
None => return Poll::Ready(None),

futures-util/src/stream/fold.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl<St, Fut, T, F> Future for Fold<St, Fut, T, F>
5252
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<T> {
5353
loop {
5454
// we're currently processing a future to produce a new accum value
55-
if self.as_mut().accum().is_none() {
55+
if self.accum.is_none() {
5656
let accum = ready!(self.as_mut().future().as_pin_mut().unwrap().poll(cx));
5757
*self.as_mut().accum() = Some(accum);
5858
self.as_mut().future().set(None);

futures-util/src/stream/for_each_concurrent.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl<St, Fut, F> Future for ForEachConcurrent<St, Fut, F>
9292
match self.as_mut().futures().poll_next_unpin(cx) {
9393
Poll::Ready(Some(())) => made_progress_this_iter = true,
9494
Poll::Ready(None) => {
95-
if self.as_mut().stream().is_none() {
95+
if self.stream.is_none() {
9696
return Poll::Ready(())
9797
}
9898
},

futures-util/src/stream/fuse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl<S: Stream> Stream for Fuse<S> {
7777
mut self: Pin<&mut Self>,
7878
cx: &mut Context<'_>,
7979
) -> Poll<Option<S::Item>> {
80-
if *self.as_mut().done() {
80+
if self.done {
8181
return Poll::Ready(None);
8282
}
8383

futures-util/src/stream/then.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl<St, Fut, F> Stream for Then<St, Fut, F>
8282
mut self: Pin<&mut Self>,
8383
cx: &mut Context<'_>,
8484
) -> Poll<Option<Fut::Output>> {
85-
if self.as_mut().future().as_pin_mut().is_none() {
85+
if self.future.is_none() {
8686
let item = match ready!(self.as_mut().stream().poll_next(cx)) {
8787
None => return Poll::Ready(None),
8888
Some(e) => e,

futures-util/src/stream/zip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl<St1, St2> Stream for Zip<St1, St2>
9090
Poll::Ready(None) | Poll::Pending => {}
9191
}
9292
}
93-
if self.as_mut().queued2().is_none() {
93+
if self.queued2.is_none() {
9494
match self.as_mut().stream2().poll_next(cx) {
9595
Poll::Ready(Some(item2)) => *self.as_mut().queued2() = Some(item2),
9696
Poll::Ready(None) | Poll::Pending => {}

futures-util/src/try_stream/try_fold.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl<St, Fut, T, F> Future for TryFold<St, Fut, T, F>
5252
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
5353
loop {
5454
// we're currently processing a future to produce a new accum value
55-
if self.as_mut().accum().is_none() {
55+
if self.accum.is_none() {
5656
let accum = match ready!(
5757
self.as_mut().future().as_pin_mut()
5858
.expect("TryFold polled after completion")

0 commit comments

Comments
 (0)