Skip to content

Commit f96fb4d

Browse files
committed
Deny clippy::unwrap_used
You must either use expect() with a proper message, or do something that won't panic. I saw some crates (for an unrelated project idea) advertise this in their docs, and it made me think of that bug I found by fuzzing the YAML chunker. The next level would be to remove expect() too and promise never to panic, but I don't know if I want to go all the way there. My expect() uses all seem pretty reasonable.
1 parent d4c860f commit f96fb4d

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
// Enforce some additional strictness on unsafe code.
1212
unsafe_op_in_unsafe_fn,
1313
clippy::undocumented_unsafe_blocks,
14+
// Avoid plain `unwrap` with no further details.
15+
clippy::unwrap_used,
1416
// Deny a number of `as` casts in favor of safer alternatives.
1517
clippy::as_underscore,
1618
clippy::ptr_as_ptr,

src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Enforce some additional strictness on unsafe code.
33
unsafe_op_in_unsafe_fn,
44
clippy::undocumented_unsafe_blocks,
5+
// Avoid plain `unwrap` with no further details.
6+
clippy::unwrap_used,
57
// Deny a number of `as` casts in favor of safer alternatives.
68
clippy::as_underscore,
79
clippy::ptr_as_ptr,

0 commit comments

Comments
 (0)