diff --git a/crates/packet-forward/src/lib.rs b/crates/packet-forward/src/lib.rs index 4493201..a983db7 100644 --- a/crates/packet-forward/src/lib.rs +++ b/crates/packet-forward/src/lib.rs @@ -2,11 +2,32 @@ #![cfg_attr(not(test), no_std)] #![cfg_attr(coverage_nightly, feature(coverage_attribute))] +#![cfg_attr(test, deny(clippy::assertions_on_result_states))] #![cfg_attr( not(test), deny( missing_docs, rust_2018_idioms, + clippy::string_to_string, + clippy::std_instead_of_core, + clippy::string_add, + clippy::str_to_string, + clippy::infinite_loop, + clippy::unwrap_used, + clippy::expect_used, + clippy::panic, + clippy::cfg_not_test, + clippy::as_conversions, + clippy::alloc_instead_of_core, + clippy::float_arithmetic, + clippy::empty_docs, + clippy::empty_line_after_doc_comments, + clippy::empty_line_after_outer_attr, + clippy::suspicious_doc_comments, + clippy::redundant_locals, + clippy::redundant_comparisons, + clippy::out_of_bounds_indexing, + clippy::empty_loop, clippy::cast_sign_loss, clippy::cast_possible_truncation, clippy::cast_possible_wrap, @@ -14,7 +35,11 @@ clippy::arithmetic_side_effects, clippy::dbg_macro, clippy::print_stdout, - clippy::print_stderr + clippy::print_stderr, + clippy::shadow_unrelated, + clippy::useless_attribute, + clippy::zero_repeat_side_effects, + clippy::builtin_type_shadow ) )] @@ -886,6 +911,9 @@ where #[inline] fn new_error_ack(message: impl fmt::Display) -> AcknowledgementStatus { AcknowledgementStatus::error( + // NB: allow expect here, because this should only fail if + // we construct an `AckStatusValue` with an empty message + #[allow(clippy::expect_used)] AckStatusValue::new(format!("{MODULE} error: {message}")) .expect("Acknowledgement error must not be empty"), ) @@ -969,6 +997,8 @@ fn next_inflight_packet( |inflight_packet| { let retries_remaining = { NonZeroU8::new( + // NB: we want to panic on purpose here + #[allow(clippy::expect_used)] inflight_packet .retries_remaining .expect("We should only hit this branch with at least one retry remaining")