diff --git a/guide/src/conversions/traits.md b/guide/src/conversions/traits.md index 82ecb17ef52..6ce57b765a1 100644 --- a/guide/src/conversions/traits.md +++ b/guide/src/conversions/traits.md @@ -522,7 +522,7 @@ struct Struct { struct Tuple<'a, K: Hash + Eq, V>(&'a str, HashMap); ``` -For structs with a single field (newtype patter) the `#[pyo3(transparent)]` option can be used to +For structs with a single field (newtype pattern) the `#[pyo3(transparent)]` option can be used to forward the implementation to the inner type. diff --git a/guide/src/migration.md b/guide/src/migration.md index a0747330e23..d5542fec32d 100644 --- a/guide/src/migration.md +++ b/guide/src/migration.md @@ -164,29 +164,6 @@ struct Struct { } ``` -will expand into the following: - -```rust -# use pyo3::prelude::*; -# use pyo3::types::PyDict; -# struct Struct { -# count: usize, -# obj: Py, -# } - -impl<'py> IntoPyObject<'py> for Struct { - type Target = PyDict; - type Output = Bound<'py, Self::Target>; - type Error = PyErr; - - fn into_pyobject(self, py: Python<'py>) -> Result { - let dict = PyDict::new(py); - dict.set_item("count", self.count)?; - dict.set_item("obj", self.obj)?; - Ok(dict) - } -} -``` #### `IntoPyObject` manual implementation