From a6b952ed3a8683bddfda49ddff9b16d7d9697406 Mon Sep 17 00:00:00 2001 From: David Hewitt Date: Wed, 13 Mar 2024 14:40:55 +0000 Subject: [PATCH] remove some redundant python reference count ops --- src/python.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/python.rs b/src/python.rs index 460a1a2..3863c7e 100644 --- a/src/python.rs +++ b/src/python.rs @@ -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()?; @@ -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); @@ -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