diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 76f82df231..206664113b 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -3203,6 +3203,8 @@ fn set_raw_should_not_panic_on_no_tty() { } #[cfg(windows)] +// Clippy suggests to remove the `NoStd` prefix from all variants. I disagree. +#[allow(clippy::enum_variant_names)] enum WinProcConstraints { NoStdIn, NoStdOut, diff --git a/core/core_isolate.rs b/core/core_isolate.rs index dc523c9828..18539395f2 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);")); }); } diff --git a/core/es_isolate.rs b/core/es_isolate.rs index 35e215cd7c..3ede1a5e42 100644 --- a/core/es_isolate.rs +++ b/core/es_isolate.rs @@ -891,23 +891,14 @@ pub mod tests { )); // First poll runs `prepare_load` hook. - assert!(match isolate.poll_unpin(cx) { - Poll::Pending => true, - _ => false, - }); + assert!(matches!(isolate.poll_unpin(cx), Poll::Pending)); assert_eq!(prepare_load_count.load(Ordering::Relaxed), 1); // Second poll actually loads modules into the isolate. - assert!(match isolate.poll_unpin(cx) { - Poll::Ready(Ok(_)) => true, - _ => false, - }); + assert!(matches!(isolate.poll_unpin(cx), Poll::Ready(Ok(_)))); assert_eq!(resolve_count.load(Ordering::Relaxed), 4); assert_eq!(load_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(_)))); assert_eq!(resolve_count.load(Ordering::Relaxed), 4); assert_eq!(load_count.load(Ordering::Relaxed), 2); })