I am writing a server and I am thinking about using some of the more restrictive clippy lints to catch possibly panicking code or lossy integer conversions.
My reasons are: On the one hand I am pretty excessive with
unwrap() during debugging and initial writing and want to catch any remainder of it in the CI. On the other hand there is a lot of buffer handling in the code and I want to ensure that any programming error there does not lead to unwinding and the difficulties with panic safety.
At one point in the code base tokio is used and the
tokio::select macro pulls in a panic. This obviously is complained about by clippy.
My questions are:
- What do you think about the aim of enabling the really restrictive clippy lints, that catch most possibilities for a panic. Does it make sense? Should I worry less about panicking in a server and just catch the unwinding?
- What should I do about
tokio::select? Also I cannot just mute the warning by placing
#[allow(clippy::panic)]on top of the select macro.