From 1c0eac26902a1ad62cff4f867c435a02c151ea65 Mon Sep 17 00:00:00 2001 From: konstin Date: Mon, 9 Apr 2018 00:00:20 +0200 Subject: [PATCH] Minor changes --- pyo3-derive-backend/src/py_impl.rs | 2 +- src/conversion.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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 {