Skip to content

Commit 0fe3f77

Browse files
committed
Simplify PyDictRef.__repr__.
1 parent 7b2d92f commit 0fe3f77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vm/src/obj/objdict.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl PyDictRef {
8989
self.entries.borrow().len()
9090
}
9191

92-
fn repr(self, vm: &VirtualMachine) -> PyResult {
92+
fn repr(self, vm: &VirtualMachine) -> PyResult<String> {
9393
let s = if let Some(_guard) = ReprGuard::enter(self.as_object()) {
9494
let mut str_parts = vec![];
9595
for (key, value) in self.get_key_value_pairs() {
@@ -102,7 +102,7 @@ impl PyDictRef {
102102
} else {
103103
"{...}".to_string()
104104
};
105-
Ok(vm.new_str(s))
105+
Ok(s)
106106
}
107107

108108
fn contains(self, key: PyObjectRef, vm: &VirtualMachine) -> PyResult<bool> {

0 commit comments

Comments
 (0)