simplify select_second
This commit is contained in:
parent
7ed5e9f255
commit
787efb3662
@ -176,13 +176,11 @@ mod future_tests {
|
||||
|
||||
#[test]
|
||||
fn select_second() {
|
||||
match futures::executor::block_on(T::select(
|
||||
let res = futures::executor::block_on(T::select(
|
||||
Box::pin(futures::future::pending::<i32>()),
|
||||
Box::pin(futures::future::ready(2)),
|
||||
)) {
|
||||
Selected::A(_, _) => panic!("first future ready"),
|
||||
Selected::B(_, b) => assert_eq!(b, 2),
|
||||
}
|
||||
));
|
||||
assert!(matches!(res, Selected::B(_, 2)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -246,15 +246,12 @@ mod tryfuture_tests {
|
||||
|
||||
#[test]
|
||||
fn select_second() {
|
||||
match futures::executor::block_on(T::select(
|
||||
let res = futures::executor::block_on(T::select(
|
||||
Box::pin(futures::future::pending::<Result<i32, _>>()),
|
||||
Box::pin(futures::future::ready(Ok(2))),
|
||||
))
|
||||
.unwrap()
|
||||
{
|
||||
Selected::A(_, _) => panic!("first future ready"),
|
||||
Selected::B(_, b) => assert_eq!(b, 2),
|
||||
}
|
||||
.unwrap();
|
||||
assert!(matches!(res, Selected::B(_, 2)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Loading…
Reference in New Issue
Block a user