chore(storage-node): remove dead code (TimingStrategyFactory, format_hsts_header)#439
Merged
Conversation
…hsts_header)
- `TimingStrategyFactory::{production,test}` (timing.rs) have zero callers
anywhere; production constructs `ExponentialBackoffTiming::default()`
directly. Remove the factory.
- `format_hsts_header` (main.rs) was `#[allow(dead_code)]` and never called;
remove it and the now-unused `HeaderValue` import.
`ImmediateTiming` is retained (exercised by a unit test). Storage node is a
binary crate, so these have no external API surface. `cargo check` clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Problem
Two dead items in the storage-node binary:
TimingStrategyFactory::{production, test}(src/timing.rs) — a factory withzero callers anywhere (workspace grep). Production constructs
ExponentialBackoffTiming::default()directly.format_hsts_header(src/main.rs) — already tagged#[allow(dead_code)]andnever called; the HSTS header it would emit is set nowhere.
Fix
TimingStrategyFactory(struct + impl).ImmediateTimingis keptbecause it's exercised by a unit test (
test_immediate_timing).format_hsts_headerand the now-unusedHeaderValueimport inmain.rs.Because
dsm_storage_nodeis a binary crate, thesepubitems have no externalconsumers — removal is safe.
Verification
cargo checkclean (no unused-import warnings after droppingHeaderValue).CI gates & coverage
Full verification for this PR runs in CI — Rust (
cargo fmt --check,clippy -D warnings, workspace tests), Frontend, Android Unit Tests,Coverage, SPDX headers, CodeQL (see the PR's Checks tab). The local
check noted above is a subset; the broader mandated gates (full workspace test
suite, codegen/scan, Android, Frontend) run in CI, not locally — none is
silently skipped.