Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoldbaum committed Oct 31, 2024
1 parent 08beaa5 commit 8421034
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/err/err_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ impl PyErrState {
// Guard against re-entrant normalization, because `Once` does not provide
// re-entrancy guarantees.
if let Some(thread) = self.normalizing_thread.lock().unwrap().as_ref() {
if *thread == std::thread::current().id() {
panic!("Re-entrant normalization of PyErrState detected");
}
assert!(
!(*thread == std::thread::current().id()),
"Re-entrant normalization of PyErrState detected"
);
}

self.normalized.call_once(|| {
Expand Down Expand Up @@ -113,7 +114,7 @@ impl PyErrState {
// Safety: self.inner will never be written again once normalized.
&*self.inner.get()
} {
Some(PyErrStateInner::Normalized(n)) => return n,
Some(PyErrStateInner::Normalized(n)) => n,
_ => unreachable!(),
}
}
Expand Down

0 comments on commit 8421034

Please sign in to comment.