You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flags every .expect() call on an Option/Result. .expect() aborts the
process immediately with no chance to recover, log structured context, or let
a caller decide how to handle the failure — unlike propagating an anyhow::Result, which this crate already uses pervasively in its command
layer.
Why it improves code quality
worktree-io already denies clippy::panic and is moving towards "no
uncontrolled aborts" as a project-wide standard. .expect() is the other
common panic vector: it's easy to reach for during development and easy to
forget to migrate to proper error handling. Catching it at lint time means
new fallible call sites get a real anyhow::Result (with a .context(...)
message) instead of a bare process abort, and any call site that's genuinely
an intentional, documented panic gets a localized #[allow] that makes the
"this can't happen" claim explicit and reviewable instead of implicit.
This follows the same pattern already established for panic, dbg_macro,
and todo in this repo's lint config.
This issue was opened by the Clippy lint improvements → issue + PR (Rust repos) → Slack routine of moadim.
Activity
github-actions commentedon Jun 30, 2026
A workspace is ready for this issue.
Powered by Worktree · Install
tupe12334 commentedon Jun 30, 2026
cc @tupe12334
chore(lint): enable clippy::expect_used (#98)