We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 553ef54 commit 2f755aeCopy full SHA for 2f755ae
1 file changed
src/types/dict.rs
@@ -518,6 +518,9 @@ impl DictIterImpl {
518
1 => unsafe { key.assume_owned_unchecked(py) },
519
x => panic!("Unknown return value from PyIter_NextItem: {}", x),
520
};
521
+ // get_item can only fail if another thread concurrently
522
+ // removed the key, so we know that remaining definitely
523
+ // needs to be decremented no matter what.
524
*remaining -= 1;
525
let value = match dict.get_item(&key) {
526
Ok(value) => value?,
0 commit comments