Skip to content

Commit f899af5

Browse files
taiki-ecramertj
authored andcommitted
Call Pin::map_unchecked_mut as method
1 parent 0598c66 commit f899af5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

futures-core/src/future/future_obj.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl<T> Future for FutureObj<'_, T> {
126126
#[inline]
127127
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<T> {
128128
let pinned_field: Pin<&mut LocalFutureObj<'_, T>> = unsafe {
129-
Pin::map_unchecked_mut(self, |x| &mut x.0)
129+
self.map_unchecked_mut(|x| &mut x.0)
130130
};
131131
LocalFutureObj::poll(pinned_field, cx)
132132
}

futures-core/src/stream/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ mod if_alloc {
167167
self: Pin<&mut Self>,
168168
cx: &mut Context<'_>,
169169
) -> Poll<Option<S::Item>> {
170-
unsafe { Pin::map_unchecked_mut(self, |x| &mut x.0) }.poll_next(cx)
170+
unsafe { self.map_unchecked_mut(|x| &mut x.0) }.poll_next(cx)
171171
}
172172
}
173173

0 commit comments

Comments
 (0)