revert pycls changes; fix word-cound-cls example

This commit is contained in:
Nikolay Kim 2017-11-18 07:20:03 -10:00
parent d02a950eb6
commit e5bf656cbc
4 changed files with 16 additions and 4 deletions

View File

@ -1,6 +1,18 @@
Changes Changes
------- -------
0.2.2 (09-26-2017)
^^^^^^^^^^^^^^^^^^
* Rustup to 1.22.0-nightly 2017-09-30
0.2.1 (09-26-2017)
^^^^^^^^^^^^^^^^^^
* Fix rustc const_fn nightly breakage
0.2.0 (08-12-2017) 0.2.0 (08-12-2017)
^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^

View File

@ -22,8 +22,8 @@ struct Words {
impl Words { impl Words {
#[new] #[new]
fn __new__(_cls: &PyType, py: Python, path: String) -> PyResult<PyObject> { fn __new__(obj: &PyRawObject, path: String) -> PyResult<()> {
Ok(py.init(|t| Words {path: path, token: t})?.into()) obj.init(|t| Words {path: path, token: t})
} }
fn search(&self, py: Python, search: String) -> PyResult<i32> { fn search(&self, py: Python, search: String) -> PyResult<i32> {

View File

@ -1,6 +1,6 @@
[package] [package]
name = "pyo3cls" name = "pyo3cls"
version = "0.2.1" version = "0.2.0"
description = "Proc macros for PyO3 package" description = "Proc macros for PyO3 package"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3"] authors = ["PyO3 Project and Contributors <https://github.com/PyO3"]
homepage = "https://github.com/pyo3/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 { |item| if item.1.py {syn::Ident::from("_py")} else {
syn::Ident::from(format!("arg{}", item.0))}).collect(); syn::Ident::from(format!("arg{}", item.0))}).collect();
let cb = quote! {{ let cb = quote! {{
#cls::#name(_obj.as_ref(), #(#names),*) #cls::#name(&_obj, #(#names),*)
}}; }};
let body = impl_arg_params(spec, cb); let body = impl_arg_params(spec, cb);