Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/salsa/tests/parallel/setup.rs')
-rw-r--r--crates/salsa/tests/parallel/setup.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/crates/salsa/tests/parallel/setup.rs b/crates/salsa/tests/parallel/setup.rs
index 0f7d06542f..0a35902b43 100644
--- a/crates/salsa/tests/parallel/setup.rs
+++ b/crates/salsa/tests/parallel/setup.rs
@@ -46,7 +46,7 @@ impl<T> WithValue<T> for Cell<T> {
fn with_value<R>(&self, value: T, closure: impl FnOnce() -> R) -> R {
let old_value = self.replace(value);
- let result = catch_unwind(AssertUnwindSafe(|| closure()));
+ let result = catch_unwind(AssertUnwindSafe(closure));
self.set(old_value);
@@ -57,18 +57,13 @@ impl<T> WithValue<T> for Cell<T> {
}
}
-#[derive(Clone, Copy, PartialEq, Eq)]
+#[derive(Default, Clone, Copy, PartialEq, Eq)]
pub(crate) enum CancellationFlag {
+ #[default]
Down,
Panic,
}
-impl Default for CancellationFlag {
- fn default() -> CancellationFlag {
- CancellationFlag::Down
- }
-}
-
/// Various "knobs" that can be used to customize how the queries
/// behave on one specific thread. Note that this state is
/// intentionally thread-local (apart from `signal`).