Update to PyO3 0.8.

master
Damir Jelić 2019-10-01 18:32:06 +02:00
parent 75f0670dd6
commit efbbd24baa
3 changed files with 8 additions and 8 deletions

View File

@ -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"]

View File

@ -1 +1 @@
nightly-2019-05-22
nightly-2019-09-24

View File

@ -20,10 +20,10 @@ use tantivy::schema::Value;
fn value_to_py(py: Python, value: &Value) -> PyResult<PyObject> {
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<PyObject> {
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),
})
}