Skip to content

Commit

Permalink
Do not use Cell impls on LocalKey due to rustc version
Browse files Browse the repository at this point in the history
  • Loading branch information
Andlon committed Jul 5, 2024
1 parent bb3d871 commit 4a1b41d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions proptest/src/is_minimal_case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ thread_local! {
/// }
/// ```
pub fn is_minimal_case() -> bool {
IS_MINIMAL_CASE.get()
IS_MINIMAL_CASE.with(|cell| cell.get())
}

/// Helper struct that helps to ensure panic safety when entering a minimal case.
Expand All @@ -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));
}
}

0 comments on commit 4a1b41d

Please sign in to comment.