Fix misuse of try_select in logical-or future util.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -4,7 +4,10 @@ use std::marker::Unpin;
|
|||||||
|
|
||||||
use futures::{
|
use futures::{
|
||||||
Future, FutureExt,
|
Future, FutureExt,
|
||||||
future::{select_ok, try_join, try_join_all, try_select},
|
future::{
|
||||||
|
Either::{Left, Right},
|
||||||
|
select_ok, try_join, try_join_all,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
pub trait BoolExt
|
pub trait BoolExt
|
||||||
@@ -53,7 +56,7 @@ where
|
|||||||
|
|
||||||
let b = b.map(|b| b.then_some(()).ok_or(Result::Err(())));
|
let b = b.map(|b| b.then_some(()).ok_or(Result::Err(())));
|
||||||
|
|
||||||
try_select(a, b).map(|result| result.is_ok())
|
select_ok([Left(a), Right(b)]).map(|result| result.is_ok())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user