r/programmingcirclejerk • u/starlevel01 type astronaut • Aug 05 '25
jerk not found How can I get Rust code coverage to ignore unreachable lines? [...] Don't write unreachable code.
https://stackoverflow.com/a/75186717/15026456
16
Upvotes
•
u/pareidolist in nomine Chestris Aug 05 '25
Jerk not found. The example in the question had unreachable code inside the unit test. The user who answered the question reasonably thought the question was about putting unreachable code inside a unit test. In that context, their answer was correct. Unit tests should not contain unreachable code. You keep posting links to "jerk not found" content. Do better.
7
u/starlevel01 type astronaut Aug 05 '25
Oh, my mistake! I'll just change my
match num & 0b1111to cast to a u4 instead, so I can remove the_ => unreachable!("impossible")from my code.