Skip to content

Commit

Permalink
remove some redundant python reference count ops
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Mar 13, 2024
1 parent 0897da4 commit a6b952e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl<'j> PythonParser<'j> {
match peek {
Peek::Null => {
self.parser.consume_null()?;
Ok(py.None().to_object(py).into_bound(py))
Ok(py.None().into_bound(py))
}
Peek::True => {
self.parser.consume_true()?;
Expand All @@ -97,7 +97,7 @@ impl<'j> PythonParser<'j> {
} else {
PyList::empty_bound(py)
};
Ok(list.to_object(py).into_bound(py))
Ok(list.into_any())
}
Peek::Object => {
let dict = PyDict::new_bound(py);
Expand All @@ -124,7 +124,7 @@ impl<'j> PythonParser<'j> {
set_item(key, value);
}
}
Ok(dict.to_object(py).into_bound(py))
Ok(dict.into_any())
}
_ => {
let n = self
Expand Down

0 comments on commit a6b952e

Please sign in to comment.