addressed nits

This commit is contained in:
tinaun
2018-06-08 23:16:51 -04:00
parent 6e5c18e8dc
commit 49eb754cc0
2 changed files with 3 additions and 24 deletions
-21
View File
@@ -932,27 +932,6 @@ fn poll(mut self: PinMut<Self>, cx: &mut Context) -> Poll<Self::Output> {
}
}
#[unstable(feature = "futures_api", issue = "50547")]
unsafe impl<F: Future<Output = ()> + Send + 'static> UnsafePoll for Box<F> {
fn into_raw(self) -> *mut () {
unsafe {
mem::transmute(self)
}
}
unsafe fn poll(task: *mut (), cx: &mut Context) -> Poll<()> {
let ptr: *mut F = mem::transmute(task);
let pin: PinMut<F> = PinMut::new_unchecked(&mut *ptr);
pin.poll(cx)
}
unsafe fn drop(task: *mut ()) {
let ptr: *mut F = mem::transmute(task);
let boxed = Box::from_raw(ptr);
drop(boxed)
}
}
#[unstable(feature = "futures_api", issue = "50547")]
unsafe impl<F: Future<Output = ()> + Send + 'static> UnsafePoll for PinBox<F> {
fn into_raw(self) -> *mut () {
+3 -3
View File
@@ -326,9 +326,9 @@ fn poll(mut self: PinMut<Self>, cx: &mut task::Context) -> Poll<Self::Output> {
unsafe {
let pinned_field = PinMut::new_unchecked(
&mut PinMut::get_mut(self.reborrow()).0
);
pinned_field.poll(cx)
);
pinned_field.poll(cx)
}
}
}