Skip to content

Commit a8df5cd

Browse files
committed
Drop redundant pickle try_to_bool clones after rebase
Assisted-by: Grok:4.6
1 parent 0abc5c9 commit a8df5cd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎crates/stdlib/src/pickle.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ mod _pickle {
15371537
Some(t) if t.len() == 2 => (t.as_slice()[0].clone(), Some(t.as_slice()[1].clone())),
15381538
_ => (state, None),
15391539
};
1540-
if !vm.is_none(&state) && state.clone().try_to_bool(vm)? {
1540+
if !vm.is_none(&state) && state.try_to_bool(vm)? {
15411541
let Some(dict) = state.downcast_ref::<PyDict>() else {
15421542
return Err(new_unpickling_error(vm, "state is not a dictionary"));
15431543
};
@@ -1552,7 +1552,7 @@ mod _pickle {
15521552
}
15531553
if let Some(slotstate) = slotstate
15541554
&& !vm.is_none(&slotstate)
1555-
&& slotstate.clone().try_to_bool(vm)?
1555+
&& slotstate.try_to_bool(vm)?
15561556
{
15571557
let Some(dict) = slotstate.downcast_ref::<PyDict>() else {
15581558
return Err(new_unpickling_error(vm, "slot state is not a dictionary"));
@@ -1582,7 +1582,7 @@ mod _pickle {
15821582
let inverted = copyreg.get_attr("_inverted_registry", vm)?;
15831583
let key = mapping_get(&inverted, code_obj.as_object(), vm)?;
15841584
let key = match key {
1585-
Some(k) if k.clone().try_to_bool(vm)? => k,
1585+
Some(k) if k.try_to_bool(vm)? => k,
15861586
_ => {
15871587
if code <= 0 {
15881588
return Err(new_unpickling_error(vm, "EXT specifies code <= 0"));

0 commit comments

Comments
 (0)