From 58cd6614ea02d125fd15ef7f0c68e8a7be53b68a Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sun, 4 Oct 2026 11:56:00 -0400 Subject: [PATCH 1/2] Never crash: engine denies the panic lints The one `unreachable!` in the scoped refresh becomes a full refresh. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 2a84de901..89b42d20c 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -10,6 +10,8 @@ //! appended revision — and the view is refreshed from it, so what you see is exactly what Save //! will write. Saving rebases onto the written bytes, so the next save appends only new edits. +#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)] + pub mod actions; pub mod catalog; pub mod commands; @@ -1929,7 +1931,8 @@ impl Session { } } } - Scope::Full => unreachable!("handled above"), + // Handled above; kept as a full refresh so the match stays total. + Scope::Full => return Self::refresh(doc), } doc.info.file_size = bytes.len(); doc.form = form; From 0e2f8a2fb3e0bc1b94f12e0f9d1c2e44bcf8a404 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sun, 4 Oct 2026 13:35:00 -0400 Subject: [PATCH 2/2] Root clippy.toml: tests may unwrap, expect, panic and index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The same file as the steering PR (#11), so this PR stands on its own. The crate-level `#![deny(clippy::unwrap_used, …)]` applies to production code only. Co-Authored-By: Claude Opus 5.5 --- clippy.toml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 clippy.toml diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 000000000..4b6c79f55 --- /dev/null +++ b/clippy.toml @@ -0,0 +1,4 @@ +allow-unwrap-in-tests = true +allow-expect-in-tests = true +allow-panic-in-tests = true +allow-indexing-slicing-in-tests = true