From 3bb38e22b912a054709cf04bc5debb5695442f45 Mon Sep 17 00:00:00 2001 From: tupe12334 Date: Thu, 2 Jul 2026 23:03:41 +0300 Subject: [PATCH] chore(lint): enable clippy::panic_in_result_fn Denies panic!/todo!/unimplemented!/unreachable! at the top level of any Result/Option-returning function, so failures must propagate via Err(_)/None instead of aborting the process. Zero existing violations. Closes #95 --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 03ce69b..a65d82a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,3 +54,6 @@ panic = "deny" # (invariants the caller already checked, intentionally documented panics) # carry a localized `#[allow]`; everywhere else propagate via `anyhow::Result`. expect_used = "deny" +# Prevent panic!() inside Result/Option-returning functions; failures must be +# returned as Err(_)/None so callers can handle them rather than crashing. +panic_in_result_fn = "deny"