From b308a774e81d7d18dfc2122459632f9ba9ae1eb8 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Fri, 14 Aug 2020 02:15:12 +0200 Subject: Fix nightly and Windows-only clippy warnings (#7095) --- core/core_isolate.rs | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'core/core_isolate.rs') 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);")); }); } -- cgit v1.2.3