Skip to content

Commit

Permalink
Bump pyo3 to 0.21.2
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Jul 3, 2024
1 parent 4de7d41 commit d117a1a
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 57 deletions.
111 changes: 59 additions & 52 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl<'source> FromPyObject<'source> for Key {
fn extract_bound(ob: &Bound<'source, PyAny>) -> PyResult<Self> {
Ok(Key {
hash: ob.hash()?,
inner: ob.unbind(),
inner: <pyo3::Bound<'_, pyo3::PyAny> as Clone>::clone(&ob).unbind(),
})
}
}
Expand Down Expand Up @@ -204,7 +204,7 @@ impl HashTrieMapPy {
let value = val.unwrap_or_else(|| &none);
for each in keys.iter()? {
let key = Key::extract_bound(&each?)?.to_owned();
inner.insert_mut(key, value.unbind());
inner.insert_mut(key, <pyo3::Bound<'_, pyo3::PyAny> as Clone>::clone(&value).unbind());
}
Ok(HashTrieMapPy { inner })
}
Expand Down Expand Up @@ -582,7 +582,7 @@ impl ItemsView {
let k = kv.get_item(0)?;
match slf.inner.get(&Key::extract_bound(&k)?) {
Some(value) => {
let pair = PyTuple::new_bound(py, [k, value.into_bound(py)]);
let pair = PyTuple::new_bound(py, [k, <Py<pyo3::PyAny> as Clone>::clone(&value).into_bound(py)]);
if !pair.eq(kv)? {
return Ok(false);
}
Expand All @@ -603,7 +603,7 @@ impl ItemsView {
let k = kv.get_item(0)?;
match slf.inner.get(&Key::extract_bound(&k)?) {
Some(value) => {
let pair = PyTuple::new_bound(py, [k, value.into_bound(py)]);
let pair = PyTuple::new_bound(py, [k, <pyo3::Py<pyo3::PyAny> as Clone>::clone(&value).into_bound(py)]);
if !pair.eq(kv)? {
return Ok(false);
}
Expand Down Expand Up @@ -641,7 +641,7 @@ impl ItemsView {
let kv = each?;
let k = kv.get_item(0)?;
if let Some(value) = slf.inner.get(&Key::extract_bound(&k)?) {
let pair = PyTuple::new_bound(py, [k, value.into_bound(py)]);
let pair = PyTuple::new_bound(py, [k, <pyo3::Py<pyo3::PyAny> as Clone>::clone(&value).into_bound(py)]);
if pair.eq(kv)? {
inner.insert_mut(Key::extract_bound(&pair)?);
}
Expand Down

0 comments on commit d117a1a

Please sign in to comment.