Minor changes

This commit is contained in:
konstin 2018-04-09 00:00:20 +02:00
parent ccbc73a385
commit 1c0eac2690
2 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ pub fn build_py_methods(ast: &mut syn::Item) -> Tokens {
}
}
fn impl_methods(ty: &Box<syn::Ty>, impls: &mut Vec<syn::ImplItem>) -> Tokens {
pub fn impl_methods(ty: &Box<syn::Ty>, impls: &mut Vec<syn::ImplItem>) -> Tokens {
// get method names in impl block
let mut methods = Vec::new();

View File

@ -309,12 +309,12 @@ impl<T> 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<Self::Inner>;
}
impl<T: ToPyObject> ReturnTypeIntoPyResult for T {
impl<T: IntoPyObject> ReturnTypeIntoPyResult for T {
type Inner = T;
default fn return_type_into_py_result(self) -> PyResult<Self::Inner> {
@ -322,7 +322,7 @@ impl<T: ToPyObject> ReturnTypeIntoPyResult for T {
}
}
impl<T: ToPyObject> ReturnTypeIntoPyResult for PyResult<T> {
impl<T: IntoPyObject> ReturnTypeIntoPyResult for PyResult<T> {
type Inner = T;
fn return_type_into_py_result(self) -> PyResult<Self::Inner> {