diff --git a/Cargo.toml b/Cargo.toml index a0b686b..7bc38b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,5 +15,5 @@ tantivy = { git = "https://github.com/tantivy-search/tantivy", branch = "master" itertools = "0.8" [dependencies.pyo3] -version = "0.7.0" +version = "0.8" features = ["extension-module"] diff --git a/rust-toolchain b/rust-toolchain index f677ace..756a627 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2019-05-22 +nightly-2019-09-24 diff --git a/src/document.rs b/src/document.rs index cffe861..58a58ea 100644 --- a/src/document.rs +++ b/src/document.rs @@ -20,10 +20,10 @@ use tantivy::schema::Value; fn value_to_py(py: Python, value: &Value) -> PyResult { Ok(match value { - Value::Str(text) => text.into_object(py), - Value::U64(num) => num.into_object(py), - Value::I64(num) => num.into_object(py), - Value::F64(num) => num.into_object(py), + Value::Str(text) => text.into_py(py), + Value::U64(num) => (*num).into_py(py), + Value::I64(num) => (*num).into_py(py), + Value::F64(num) => (*num).into_py(py), Value::Bytes(b) => b.to_object(py), Value::Date(d) => PyDateTime::new( py, @@ -36,8 +36,8 @@ fn value_to_py(py: Python, value: &Value) -> PyResult { d.timestamp_subsec_micros(), None, )? - .into_object(py), - Value::Facet(f) => Facet { inner: f.clone() }.into_object(py), + .into_py(py), + Value::Facet(f) => Facet { inner: f.clone() }.into_py(py), }) }