diff --git a/proptest/src/is_minimal_case.rs b/proptest/src/is_minimal_case.rs index 65b5c9fa..39fb6def 100644 --- a/proptest/src/is_minimal_case.rs +++ b/proptest/src/is_minimal_case.rs @@ -49,13 +49,13 @@ pub(crate) struct MinimalCaseGuard; impl MinimalCaseGuard { pub(crate) fn begin_minimal_case() -> Self { - IS_MINIMAL_CASE.replace(true); + IS_MINIMAL_CASE.with(|cell| cell.replace(true)); Self } } impl Drop for MinimalCaseGuard { fn drop(&mut self) { - IS_MINIMAL_CASE.replace(false); + IS_MINIMAL_CASE.with(|cell| cell.replace(false)); } } \ No newline at end of file