Skip to content

Commit 146c397

Browse files
committed
ci: fix nightly warning about unreachable pattern (#4437)
* ci: fix nightly warning about unreachable pattern * add comment
1 parent 08a1630 commit 146c397

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/sync.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,9 @@ impl<T> GILOnceCell<T> {
126126
return value;
127127
}
128128

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

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

0 commit comments

Comments
 (0)