Skip to content

Commit

Permalink
ci: fix nightly warning about unreachable pattern (#4437)
Browse files Browse the repository at this point in the history
* ci: fix nightly warning about unreachable pattern

* add comment
  • Loading branch information
davidhewitt authored Aug 12, 2024
1 parent 0958568 commit 7760d6b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,9 @@ impl<T> GILOnceCell<T> {
return value;
}

match self.init(py, || Ok::<T, std::convert::Infallible>(f())) {
Ok(value) => value,
Err(void) => match void {},
}
// .unwrap() will never panic because the result is always Ok
self.init(py, || Ok::<T, std::convert::Infallible>(f()))
.unwrap()
}

/// Like `get_or_init`, but accepts a fallible initialization function. If it fails, the cell
Expand Down

0 comments on commit 7760d6b

Please sign in to comment.