From ab92fa2c2cd5cb3e8cb2fdf14931f2c9d6b48e86 Mon Sep 17 00:00:00 2001 From: tupe12334 Date: Tue, 30 Jun 2026 21:09:16 +0300 Subject: [PATCH] chore(lint): enable clippy::panic_in_result_fn Deny panic!/todo!/unimplemented!/unreachable! inside functions that return Result or Option. When a function's return type already models failure, an internal panic bypasses structured error propagation and crashes the process instead of returning Err(_)/None for callers to handle. The codebase has zero violations today; this commit locks in that clean state and prevents future regressions. Closes #95 --- Cargo.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 23d5827..97a1dbe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,3 +49,8 @@ dbg_macro = "deny" todo = "deny" # Forbid explicit `panic!` calls; unreachable arms belong in `unreachable!` panic = "deny" +# Prevent panic!/todo!/unimplemented!/unreachable! inside Result/Option-returning +# functions. When a function already signals fallibility via its return type, +# any internal panic bypasses structured error propagation and crashes the +# process instead of returning Err(_)/None for the caller to handle. +panic_in_result_fn = "deny"