manual-assert Prefer assertions over conditional panics An if branch whose only operation is panic expresses an assertion through manual control flow. Instead, you SHOULD use assert with the opposite condition. Wrap a computed message in a zero-argument lambda so it is evaluated only after failure. - Category: style - Level: warning - Fix: none - Scope: module Reported import { panic } from "destack:error"; function divide(value: int32, divisor: int32): int32 { if (divisor == 0) { panic("divisor must not be zero"); } return value / divisor; } Accepted import { assert } from "destack:assert"; function divide(value: int32, divisor: int32): int32 { assert(divisor != 0, "divisor must not be zero"); return value / divisor; } Prior art - Clippy ยท manualassert language/linter/src/rules/style/manualassert.rs:6