Skip to content

Commit

Permalink
Generalize compat::select!
Browse files Browse the repository at this point in the history
  • Loading branch information
iovxw committed Mar 4, 2024
1 parent 9bd67f3 commit 3eb1217
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ pub use tokio::select;
#[cfg(feature = "async-io")]
#[macro_export]
macro_rules! select {
($(Some($val:ident) = $exp:expr => $blk:block)*) => {
($($patten:pat = $exp:expr => $blk:block)*) => {
futures_util::select! {
$( $val = $exp => {
let Some($val) = $val else { continue };
$( v = $exp => {
let $patten = v else { continue };
$blk
} )*
}
Expand Down

0 comments on commit 3eb1217

Please sign in to comment.