refactor: remove stale dead code#10238
Conversation
|
Complex PR? Review this PR in Change Stack to move by importance, not file order. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (15)
💤 Files with no reviewable changes (6)
📝 WalkthroughWalkthroughThis PR removes unused public APIs and simplifies data structures across multiple backend and configuration modules. Changes include removing fields from ChangesAPI cleanup and schema simplification
🎯 4 (Complex) | ⏱️ ~75 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR removes accumulated dead code across 16 files — helpers, fields, enum variants, and trait methods that were introduced in earlier PRs but whose call sites were subsequently removed or replaced. Each deletion is backed by a traceable history in the PR description.
Confidence Score: 5/5Pure dead-code removal with no behavioral changes; all deletions are verified by the author against Every removed symbol is either call-site-free (confirmed by Clippy) or only referenced by its own unit tests, which are also removed. The one non-trivial transformation — inlining No files require special attention. Important Files Changed
Reviews (5): Last reviewed commit: "refactor: restore progress_report and ta..." | Re-trigger Greptile |
42cf883 to
697f5fc
Compare
Drop helpers that only existed for removed APIs (Redactor::patterns, MinVersionSpec::Display, IdiomaticVersionFile::init) and inline the unused public Config::get_tool_opts accessor into resolve_tool_opts.
Reflect MinVersionSpec derived Debug output after removing Display.
Keep ProgressIcon::Warning/Error in progress_report and TaskTemplate hide/quiet/raw fields out of this dead-code cleanup PR. Template output flags are a separate bug fix, not stale code removal.
Summary
#[allow(dead_code)]annotations into this branch.github/workflows/test.ymlalready runscargo clippy -- -D warningsandcargo clippy --all-features --all-targets -- -D warningsRemoved stale code
Option source / backend args
ResolvedToolOptions::has_any_key_except_from_sources— added in #9306 but never wired to production; only its unit-test assertion referenced it.BackendArg::full_with_opts— introduced in #4960 / #6807; last production caller removed in #8448 (write_backend_metaswitched tofull_without_opts()). Tests added later in #9124 and #9958 kept it alive for Clippy.Config::get_tool_opts— introduced in #7655; external callers migrated toget_tool_opts_with_overrides/resolve_tool_opts_with_overridesin #9306, leaving this accessor as an unused wrapper that was inlined here.Config / env
ConfigFile::config_typeand its impls — introduced in #4902; last callers removed in #6501 when idiomatic version file handling changed. Idiomatic impls lingered through #8171 without new call sites.IdiomaticVersionFile::init— added in #8171 for the generic idiomatic parser refactor, but never called.Config::vars_resultsandvars_loader— introduced in #6401; production immediately usedvars_results_cached()instead, so the async accessor and loader back-reference were never called.MinVersionSpecmutators,is_empty,merge_with, andDisplay— introduced in #6433; specs are built via parsing/newand checked throughhard_violation/soft_violation, so write/merge/display helpers were never used.MiseTomldebug snapshot updated to use derivedDebugoutput.Deps / platform / plugins
DepsProviderConfig::is_customandDepsConfig::{merge,get}— introduced in #9056; the deps engine reads provider maps directly and never called these helpers.Platform::{is_compatible_with_current,is_arm64,is_x64}— introduced in #6227; only referenced from their own unit tests after platform resolution moved to validation, lockfile keys, and OS helpers.PluginEnum::install— added in #5172 alongsideensure_installed, but install flows always usedensure_installed/ concrete plugin methods instead.Backend::warn_if_dependencies_missing— introduced with a caller in #3104; last caller removed in #3172. The trait default lingered and was updated in #5172 / #5223, but no call sites were restored.Redactions / lockfile metadata
Redactions::{merge,render,is_empty}— introduced in #3529; runtime redaction moved toRedactorin #7931, leaving these methods unused.Redactor::patterns— added withRedactorin #7931; only a unit test referenced it (patterns_arc()is used in production).tera::render_str_if_template— introduced in #9833; production call sites in that PR switched tocontains_template_syntax+render_str, and the only remaining caller was the already-deadRedactions::renderpath.GitHubReleaseInfo::{repo,release_type}andReleaseType— introduced in #6228 / #6230; platform lock resolution only readsasset_patternandapi_url, so the other fields were write-only scaffolding.Out of scope (handled separately)
ProgressIcon::{Warning,Error}— restored on this branch; kept for future use.TaskTemplate::{hide,quiet,raw}— not dead code; schema/runtime mismatch tracked in #10242.Verification
cargo fmt --all -- --checkgit diff --checkcargo clippy -- -D warningscargo clippy --all-features --all-targets -- -D warningscargo test config::config_file::mise_toml::tests::test_envcargo test tool_optionsfails before running tests in unrelated Aqua test code (AquaPackage::complete_windows_ext_to_file_src,complete_windows_ext_to_file_dst, andwindows_extare missing); this PR does not modifysrc/backend/aqua.rsorcrates/aqua-registry.Summary by CodeRabbit