Skip to content

Commit 3a0aa92

Browse files
committed
rename to release
1 parent c6105c9 commit 3a0aa92

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/random.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl Drop for PyBitGeneratorGuard {
156156
// 2. We hold the `BitGenerator.capsule`, so it can’t be deallocated.
157157
impl<'py> PyBitGeneratorGuard {
158158
/// Release the lock, allowing for checking for errors.
159-
pub fn try_release(self, py: Python<'py>) -> PyResult<()> {
159+
pub fn release(self, py: Python<'py>) -> PyResult<()> {
160160
self.lock.bind(py).call_method0("release")?;
161161
Ok(())
162162
}
@@ -225,7 +225,7 @@ mod tests {
225225
py.allow_threads(|| {
226226
let _ = bitgen.next_raw();
227227
});
228-
assert!(bitgen.try_release(py).is_ok());
228+
assert!(bitgen.release(py).is_ok());
229229
Ok(())
230230
})
231231
}
@@ -276,7 +276,7 @@ mod tests {
276276
assert!(bitgen.random_ratio(1, 1));
277277
assert!(!bitgen.random_ratio(0, 1));
278278
});
279-
assert!(bitgen.try_release(py).is_ok());
279+
assert!(bitgen.release(py).is_ok());
280280
Ok(())
281281
})
282282
}
@@ -287,7 +287,7 @@ mod tests {
287287
let generator = get_bit_generator(py)?;
288288
let bitgen = generator.lock()?;
289289
assert!(generator.lock().is_err());
290-
assert!(bitgen.try_release(py).is_ok());
290+
assert!(bitgen.release(py).is_ok());
291291
Ok(())
292292
})
293293
}

0 commit comments

Comments
 (0)