mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-17 01:51:39 +09:00
Remove outer RefCell from PyObjectRef
This commit is contained in:
@@ -65,7 +65,7 @@ impl<'s> serde::Serialize for PyObjectSerializer<'s> {
|
||||
map.serialize_entry(&key, &self.clone_with_object(&e.1))?;
|
||||
}
|
||||
map.end()
|
||||
} else if let PyObjectPayload::None = self.pyobject.borrow().payload {
|
||||
} else if let PyObjectPayload::None = self.pyobject.payload {
|
||||
serializer.serialize_none()
|
||||
} else {
|
||||
Err(serde::ser::Error::custom(format!(
|
||||
@@ -167,7 +167,7 @@ impl<'de> Visitor<'de> for PyObjectDeserializer<'de> {
|
||||
// than wrapping the given object up and then unwrapping it to determine whether or
|
||||
// not it is a string
|
||||
while let Some((key_obj, value)) = access.next_entry_seed(self.clone(), self.clone())? {
|
||||
let key = match key_obj.borrow().payload {
|
||||
let key = match key_obj.payload {
|
||||
PyObjectPayload::String { ref value } => value.clone(),
|
||||
_ => unimplemented!("map keys must be strings"),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user