Skip to content

Commit

Permalink
Remove try_ready! macro
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e authored and cramertj committed May 14, 2019
1 parent 21f1ed3 commit 7b5c732
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
16 changes: 0 additions & 16 deletions futures-util/src/macros/poll.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
/// Extracts the successful type of a `Poll<Result<T, E>>`.
///
/// This macro bakes in propagation of `Pending` and `Err` signals by returning early.
#[macro_export]
macro_rules! try_ready {
($x:expr) => {
match $x {
$crate::core_reexport::task::Poll::Ready(Ok(x)) => x,
$crate::core_reexport::task::Poll::Ready(Err(e)) =>
return $crate::core_reexport::task::Poll::Ready(Err(e.into())),
$crate::core_reexport::task::Poll::Pending =>
return $crate::core_reexport::task::Poll::Pending,
}
}
}

/// Extracts the successful type of a `Poll<T>`.
///
/// This macro bakes in propagation of `Pending` signals by returning early.
Expand Down
5 changes: 1 addition & 4 deletions futures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ compile_error!("The `never-type` feature requires the `nightly` feature as an ex
#[doc(hidden)] pub use futures_core::task::Poll;

// Macro reexports
pub use futures_util::{
// Error/readiness propagation
try_ready, ready,
};
pub use futures_util::ready; // Readiness propagation
#[cfg(feature = "async-await")]
pub use futures_util::{
// Async-await
Expand Down

0 comments on commit 7b5c732

Please sign in to comment.