Skip to content

Commit c6493df

Browse files
committed
rename bitgen type
1 parent e73e3a2 commit c6493df

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/npyffi/random.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::ffi::c_void;
22

33
#[repr(C)]
44
#[derive(Debug)]
5-
pub struct npy_bitgen {
5+
pub struct bitgen_t {
66
pub state: *mut c_void,
77
pub next_uint64: unsafe extern "C" fn(*mut c_void) -> super::npy_uint64, //nogil
88
pub next_uint32: unsafe extern "C" fn(*mut c_void) -> super::npy_uint32, //nogil

src/random.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ use pyo3::{
5959
PyTypeInfo,
6060
};
6161

62-
use crate::npyffi::npy_bitgen;
62+
use crate::npyffi::bitgen_t;
6363

6464
/// Wrapper for [`np.random.BitGenerator`][bg].
6565
///
@@ -109,7 +109,7 @@ impl<'py> PyBitGeneratorMethods for Bound<'py, PyBitGenerator> {
109109
lock.call_method0("acquire")?;
110110

111111
assert_eq!(capsule.name()?, Some(c"BitGenerator"));
112-
let ptr = capsule.pointer() as *mut npy_bitgen;
112+
let ptr = capsule.pointer() as *mut bitgen_t;
113113
let Some(non_null) = NonNull::new(ptr) else {
114114
lock.call_method0("release")?;
115115
return Err(PyRuntimeError::new_err("Invalid BitGenerator capsule"));
@@ -131,7 +131,7 @@ impl<'py> TryFrom<&Bound<'py, PyBitGenerator>> for PyBitGeneratorGuard {
131131

132132
/// [`PyBitGenerator`] lock allowing to access its methods without holding the GIL.
133133
pub struct PyBitGeneratorGuard {
134-
raw_bitgen: NonNull<npy_bitgen>,
134+
raw_bitgen: NonNull<bitgen_t>,
135135
/// This field makes sure the `raw_bitgen` inside the capsule doesn’t get deallocated.
136136
_capsule: Py<PyCapsule>,
137137
/// This lock makes sure no other threads try to use the BitGenerator while we do.

0 commit comments

Comments
 (0)