diff options
Diffstat (limited to 'core/core_isolate.rs')
-rw-r--r-- | core/core_isolate.rs | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/core/core_isolate.rs b/core/core_isolate.rs index dc523c982..18539395f 100644 --- a/core/core_isolate.rs +++ b/core/core_isolate.rs @@ -991,10 +991,7 @@ pub mod tests { "#, )); assert_eq!(dispatch_count.load(Ordering::Relaxed), 1); - assert!(match isolate.poll_unpin(cx) { - Poll::Ready(Ok(_)) => true, - _ => false, - }); + assert!(matches!(isolate.poll_unpin(cx), Poll::Ready(Ok(_)))); assert_eq!(dispatch_count.load(Ordering::Relaxed), 1); js_check(isolate.execute( "check2.js", @@ -1005,17 +1002,11 @@ pub mod tests { "#, )); assert_eq!(dispatch_count.load(Ordering::Relaxed), 2); - assert!(match isolate.poll_unpin(cx) { - Poll::Ready(Ok(_)) => true, - _ => false, - }); + assert!(matches!(isolate.poll_unpin(cx), Poll::Ready(Ok(_)))); js_check(isolate.execute("check3.js", "assert(nrecv == 2)")); assert_eq!(dispatch_count.load(Ordering::Relaxed), 2); // We are idle, so the next poll should be the last. - assert!(match isolate.poll_unpin(cx) { - Poll::Ready(Ok(_)) => true, - _ => false, - }); + assert!(matches!(isolate.poll_unpin(cx), Poll::Ready(Ok(_)))); }); } @@ -1037,10 +1028,7 @@ pub mod tests { assert_eq!(dispatch_count.load(Ordering::Relaxed), 1); // The above op never finish, but isolate can finish // because the op is an unreffed async op. - assert!(match isolate.poll_unpin(cx) { - Poll::Ready(Ok(_)) => true, - _ => false, - }); + assert!(matches!(isolate.poll_unpin(cx), Poll::Ready(Ok(_)))); }) } @@ -1167,10 +1155,7 @@ pub mod tests { "#, )); assert_eq!(dispatch_count.load(Ordering::Relaxed), 1); - assert!(match isolate.poll_unpin(cx) { - Poll::Ready(Ok(_)) => true, - _ => false, - }); + assert!(matches!(isolate.poll_unpin(cx), Poll::Ready(Ok(_)))); js_check(isolate.execute("check.js", "assert(asyncRecv == 1);")); }); } |