| Forbidden Pattern | Required Alternative |
|---|---|
value.unwrap() | match value { Some(v) => v, None => return Err(...) } |
result.expect("msg") | match result { Ok(v) => v, Err(e) => return Err(e.into()) } |
collection[index] | collection.get(index).ok_or(Error::OutOfBounds)? |
a + b (integers) | a.checked_add(b).ok_or(Error::Overflow)? |
ptr.read() | ptr.read_volatile() (for MMIO) |
zeroize crate for sensitive data cleanup (keys, passwords, etc.)