Fix the clippy pedantic warnings in walgit-config - #28
Open
0bserver07 wants to merge 1 commit into
Open
Conversation
The lint gate merged in tobi#15 left 45 warned locations in this crate across 17 lints: Duration values built from seconds where a minute or hour constructor reads the same, doc comments missing backticks or a paragraph break, a Result unwrap and four indexing sites clippy counts as panic paths, and a set of mechanical style lints such as redundant closures, map().unwrap_or and a collapsible if. Every Duration keeps its exact value, so no default moved: from_secs(7 * 24 * 3600) is now from_hours(7 * 24), and the rest follow the same rule. The env override walker takes the path apart with split_first instead of indexing it, which removes the panic path while a well formed path behaves as before. The default listen address is built with SocketAddr::from instead of parsed, so that unwrap is gone rather than renamed. The three structs that mirror a TOML section carry a targeted allow for struct_excessive_bools, because folding their flags into enums would change the shape of walgit.toml; it is the only allow added. Config's Default impl is derived now, which is what the hand written one did field by field. Checked with cargo clippy -p walgit-config --all-targets --no-deps -- -D warnings for zero warnings, cargo test -p walgit-config for 12 passing tests, cargo fmt --all -- --check, and cargo check -p walgit-server to show the public API is untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 27, 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.
Second slice of the debt #15 described, after #23 did walgit-proto. This gets
cargo clippy -p walgit-config --all-targets -- -D warningsto zero. One file:crates/walgit-config/src/lib.rs.Most of it is mechanical:
Durationvalues written in seconds now use the minute or hour constructor. Every value is identical; no default moved.map().unwrap_orchains and a collapsibleiftake clippy's suggestion.WALGIT__env override walker takes the path apart withsplit_firstinstead of indexing it, so the panic path is gone and well formed paths behave exactly as before.SocketAddr::frominstead of parsed, so thatunwrapis gone rather than renamed.#[allow(clippy::struct_excessive_bools)], since turning their flags into enums would changewalgit.toml. That's the only allow in here.Checked with clippy on the crate (zero warnings),
cargo test -p walgit-config(12 pass),cargo fmt, andcargo check -p walgit-serverto show the public API is unchanged. walgit-git is next if this shape works for you; it has 184 warnings in its lib.