diff --git a/pyo3-derive-backend/src/py_impl.rs b/pyo3-derive-backend/src/py_impl.rs index c53ac69b..f3b07e60 100644 --- a/pyo3-derive-backend/src/py_impl.rs +++ b/pyo3-derive-backend/src/py_impl.rs @@ -19,7 +19,7 @@ pub fn build_py_methods(ast: &mut syn::Item) -> Tokens { } } -fn impl_methods(ty: &Box, impls: &mut Vec) -> Tokens { +pub fn impl_methods(ty: &Box, impls: &mut Vec) -> Tokens { // get method names in impl block let mut methods = Vec::new(); diff --git a/src/conversion.rs b/src/conversion.rs index 37165e96..86e3d0ed 100644 --- a/src/conversion.rs +++ b/src/conversion.rs @@ -309,12 +309,12 @@ impl PyTryFrom for T where T: PyTypeInfo { /// whether a return type is a (possibly aliased) PyResult or not. It is also quite handy because /// the codegen is currently built on the assumption that all functions return a PyResult. pub trait ReturnTypeIntoPyResult { - type Inner: ToPyObject; + type Inner; fn return_type_into_py_result(self) -> PyResult; } -impl ReturnTypeIntoPyResult for T { +impl ReturnTypeIntoPyResult for T { type Inner = T; default fn return_type_into_py_result(self) -> PyResult { @@ -322,7 +322,7 @@ impl ReturnTypeIntoPyResult for T { } } -impl ReturnTypeIntoPyResult for PyResult { +impl ReturnTypeIntoPyResult for PyResult { type Inner = T; fn return_type_into_py_result(self) -> PyResult {