You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Codecs should be hardened to the point where they cannot panic under any circumstance. This means no unwrap, no array indexes that could be out-of-bounds, etc. Any problem with the codec should return a specific error.
The problem is with detecting these panic conditions. There are a few features that could help:
The missing_panics_doc, unwrap_used and expect_used clippy lints are great to warn about common panic points (the first one also warning upon panic! and assert!).
The no_panic crate looks also helpful, but is limited to actual programs and requires some level of optimization to be really useful.
The text was updated successfully, but these errors were encountered:
Gnurou
changed the title
codec module should never panic in any conditioncodec module should never panic under any condition
Jun 24, 2024
Codecs should be hardened to the point where they cannot panic under any circumstance. This means no
unwrap
, no array indexes that could be out-of-bounds, etc. Any problem with the codec should return a specific error.The problem is with detecting these panic conditions. There are a few features that could help:
missing_panics_doc
,unwrap_used
andexpect_used
clippy lints are great to warn about common panic points (the first one also warning uponpanic!
andassert!
).The text was updated successfully, but these errors were encountered: