Fix documents and a clippy warning
This commit is contained in:
parent
acb1120c55
commit
d5cff058ef
|
@ -87,7 +87,7 @@ pyo3::inventory::collect!(MyClassGeneratedPyo3Inventory);
|
|||
|
||||
|
||||
## Get Python objects from `pyclass`
|
||||
You sometimes need to convert your pyclass into Python object in Rust code(e.g., for testing it).
|
||||
You sometimes need to convert your `pyclass` into a Python object in Rust code (e.g., for testing it).
|
||||
|
||||
You can use `PyClassShell<T>` or `Py<T>` for this purpose.
|
||||
|
||||
|
@ -95,8 +95,8 @@ You can use `PyClassShell<T>` or `Py<T>` for this purpose.
|
|||
|
||||
`PyClassShell` is a special type made for `PyClass`.
|
||||
|
||||
It represents the actual layout of pyclass in Python world and used to extract it from
|
||||
Python object pointer.
|
||||
It represents the actual layout of `pyclass` on the Python heap and is used to extract it from
|
||||
the Python object pointer.
|
||||
|
||||
To make pyclass in Python heap, you can use `PyClassShell::new_ref` or `PyClassShell::new_mut`.
|
||||
|
||||
|
|
|
@ -371,7 +371,7 @@ impl<T: PyTypeInfo> PyClassInitializer<T> {
|
|||
}
|
||||
let super_init = Box::into_raw(Box::new(PyClassInitializer::new()));
|
||||
self.super_init = Some(super_init);
|
||||
return unsafe { &mut *super_init };
|
||||
unsafe { &mut *super_init }
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
|
|
|
@ -37,7 +37,7 @@ impl PyClassWeakRef for PyClassDummySlot {
|
|||
}
|
||||
}
|
||||
|
||||
/// actural dict field
|
||||
/// actual dict field
|
||||
#[repr(transparent)]
|
||||
pub struct PyClassDictSlot(*mut ffi::PyObject);
|
||||
|
||||
|
@ -54,7 +54,7 @@ impl PyClassDict for PyClassDictSlot {
|
|||
}
|
||||
}
|
||||
|
||||
/// actural weakref field
|
||||
/// actual weakref field
|
||||
#[repr(transparent)]
|
||||
pub struct PyClassWeakRefSlot(*mut ffi::PyObject);
|
||||
|
||||
|
|
Loading…
Reference in a new issue