Fix documents and a clippy warning

This commit is contained in:
kngwyu 2019-12-23 02:09:36 +09:00
parent acb1120c55
commit d5cff058ef
3 changed files with 6 additions and 6 deletions

View file

@ -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`.

View file

@ -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)]

View file

@ -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);