task: remove deprecated JoinError constructors (#2900)

This commit is contained in:
Alice Ryhl
2020-10-02 01:01:11 +03:00
committed by GitHub
parent 496e889917
commit 13de30c53e
2 changed files with 6 additions and 18 deletions
+2 -14
View File
@@ -16,25 +16,13 @@ enum Repr {
}
impl JoinError {
#[doc(hidden)]
#[deprecated]
pub fn cancelled() -> JoinError {
Self::cancelled2()
}
pub(crate) fn cancelled2() -> JoinError {
pub(crate) fn cancelled() -> JoinError {
JoinError {
repr: Repr::Cancelled,
}
}
#[doc(hidden)]
#[deprecated]
pub fn panic(err: Box<dyn Any + Send + 'static>) -> JoinError {
Self::panic2(err)
}
pub(crate) fn panic2(err: Box<dyn Any + Send + 'static>) -> JoinError {
pub(crate) fn panic(err: Box<dyn Any + Send + 'static>) -> JoinError {
JoinError {
repr: Repr::Panic(Mutex::new(err)),
}
+4 -4
View File
@@ -102,7 +102,7 @@ where
// If the task is cancelled, avoid polling it, instead signalling it
// is complete.
if snapshot.is_cancelled() {
Poll::Ready(Err(JoinError::cancelled2()))
Poll::Ready(Err(JoinError::cancelled()))
} else {
let res = guard.core.poll(self.header());
@@ -132,7 +132,7 @@ where
}
}
Err(err) => {
self.complete(Err(JoinError::panic2(err)), snapshot.is_join_interested());
self.complete(Err(JoinError::panic(err)), snapshot.is_join_interested());
}
}
}
@@ -297,9 +297,9 @@ where
// Dropping the future panicked, complete the join
// handle with the panic to avoid dropping the panic
// on the ground.
self.complete(Err(JoinError::panic2(err)), true);
self.complete(Err(JoinError::panic(err)), true);
} else {
self.complete(Err(JoinError::cancelled2()), true);
self.complete(Err(JoinError::cancelled()), true);
}
}