use as_ref for PyRawObject in __new__ wrapper

This commit is contained in:
Nikolay Kim 2017-11-18 07:07:19 -10:00
parent eb9050ab90
commit b5ffefc50c
2 changed files with 2 additions and 2 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "pyo3cls"
version = "0.2.0"
version = "0.2.1"
description = "Proc macros for PyO3 package"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3"]
homepage = "https://github.com/pyo3/pyo3"

View file

@ -128,7 +128,7 @@ pub fn impl_wrap_new(cls: &Box<syn::Ty>, name: &syn::Ident, spec: &FnSpec) -> To
|item| if item.1.py {syn::Ident::from("_py")} else {
syn::Ident::from(format!("arg{}", item.0))}).collect();
let cb = quote! {{
#cls::#name(&_obj, #(#names),*)
#cls::#name(_obj.as_ref(), #(#names),*)
}};
let body = impl_arg_params(spec, cb);