chore: remove an unused import and a command attribute nothing could reach - #575
Merged
Conversation
…reach Two dead things, one of which was lying rather than merely unused. `State` had not been imported for anything in lib.rs for long enough that a doc comment refers to it in the past tense. It was the only warning `cargo check` produced; the build is now clean. `convert_markdown` carried `#[tauri::command]` while never appearing in `generate_handler!`. The function is not dead -- it is the renderer `render_markdown` and `build_markdown_preview` call underneath -- but the attribute claimed an exposure the app does not have. No `invoke` could ever have reached it, and nothing would have said so: a command name is a string with no compiler behind it in either direction. So the attribute goes, and scripts/tauriCommandRegistration.test.ts holds both directions of the list instead. 51 declared, 50 registered, and the one that did not match is the reason this was found at all -- by reading the two lists side by side, which is exactly the work a test should be doing. Also swept, and deliberately left alone: 19 exported types in src/lib that no other file imports. Every one is used inside its own file, so they are over-exported rather than dead, and removing `export` from a type that is already correct is churn with review cost and no benefit. cargo check clean, 967 tests pass, svelte-check clean. Both assertions mutation-checked: restoring the attribute fails the first and not the second. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two dead things, one of which was lying rather than merely unused. Also the first pull request that can read the cargo caches #574 seeded, so the numbers below are worth watching.
StateUnused in
lib.rsfor long enough that a doc comment refers to it in the past tense. It was the only warningcargo checkproduced; the build is now clean.convert_markdownclaimed to be a Tauri commandIt carried
#[tauri::command]while never appearing ingenerate_handler!.The function is not dead — it is the renderer that
render_markdownandbuild_markdown_previewcall underneath. What was dead was the attribute: noinvokecould ever have reached it, and nothing would have said so. A command name is a string with no compiler behind it in either direction, so an attribute claiming an exposure the app does not have compiles happily and reads as live code forever.So the attribute goes, and a test holds both directions of the list instead:
It was found by reading the two lists side by side, which is exactly the work a test should be doing rather than a person.
Swept and deliberately left alone
19 exported types in
src/libthat no other file imports —TocSide,PdfExportContext,HeadingReferenceand so on. Every one is used inside its own file, so they are over-exported rather than dead. Removingexportfrom a type that is already correct is churn with review cost and no benefit.No other Rust warnings across
--all-targets, and no unregistered commands beyond the one above.Verification
cargo check --all-targetsnpm testnpm run checkIncidentally: the cache measurement
#574 seeded four cargo caches on master (4.45 GB of a 10 GB budget) with a cold run that took Linux 12m49s, Windows 16m03s, macOS 17m30s. This is the first pull request that can restore them.
The comparison to make is against 12m14s — the Linux baseline #572 was written from, and the number that had not moved at all before this. #574 says so explicitly: if it has not moved meaningfully now, the honest response is to revert the caching rather than keep it as decoration.
🤖 Generated with Claude Code