Remove outer RefCell from PyObjectRef

This commit is contained in:
Joey Hain
2019-02-25 19:01:01 -08:00
parent 027a6847e5
commit f10fa6db44
33 changed files with 380 additions and 425 deletions

View File

@@ -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"),
};