Summary
We are using a hack for representing a null block index by doing:
|
impl BlockIdx { |
|
pub const NULL: Self = Self::new(u32::MAX); |
I think it would be better to remove this hack and using a proper Option<BlockIdx> for representing Some(BlockIdx) or a None it would ensure a proper care for a None/Some cases instead of using an if condition (which is more error prone) like:
if target == BlockIdx::NULL {
...
} else {
...
}
Summary
We are using a hack for representing a null block index by doing:
RustPython/crates/codegen/src/ir.rs
Lines 49 to 50 in 9f250a0
I think it would be better to remove this hack and using a proper
Option<BlockIdx>for representingSome(BlockIdx)or aNoneit would ensure a proper care for aNone/Somecases instead of using anifcondition (which is more error prone) like: