Fix clippy warnings - #22
Merged
Merged
Conversation
Contributor
Author
|
I used claude code to implement but have reviewed the changes and they look sane to me |
noonchen
reviewed
Jun 9, 2026
noonchen
left a comment
Owner
There was a problem hiding this comment.
Please confirm this file compiles
Owner
|
@henrik-nil-acc thanks for this PR, I am about to do it myself some days later, but you are way ahead of me! |
Owner
|
I have updated the workflow, try merging from main to fix coverage failure. |
Cover two previously untested paths: ATDF time fields render a fixed UTC string, and read_kx_cf with k=0 returns an empty vec without moving the cursor.
Deprecated since chrono 0.4.35 in favor of DateTime::from_timestamp. Output is identical. Bump the chrono floor to 0.4.31, the first release with from_timestamp, so the declared minimum builds.
vec![ctor; 0] built an element only to discard it. Build the empty vec directly and drop the now-unused macro default argument.
bitcount.div_ceil(8) replaces the hand-rolled (bitcount + 7) / 8. It reads clearer and is overflow-safe. Raises the effective MSRV to Rust 1.73, where usize::div_ceil stabilized.
pos is already usize, so the (*pos as usize) cast was a no-op.
Make the transmute's source type and the iterators' elided &mut self lifetimes explicit. Also document why the 'static extension is sound: stable Box address, drop order, and no aliasing while the file is alive.
The empty if did nothing. The field it read is now write-only, but its value comes from from_atdf_string's frozen public param, so keep it as allow(dead_code) rather than change the signature.
The doc comment sat on commented-out code. The bare `use serde_json;` is redundant under edition 2021, since the crate is already in scope via fully-qualified paths. Neither is load-bearing.
Clear the remaining clippy lints in test code (single_match, ptr_arg, clone_on_copy, expect_fun_call). Behavior is preserved, except a file-open failure now reports the underlying error.
henrik-nil-acc
force-pushed
the
fix-clippy
branch
from
June 9, 2026 06:16
ca2fe02 to
1dc3599
Compare
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.
cargo clippy --all-targets --all-featuresis now clean. No API changes,no behavior changes except the chrono swap below.
from_timestamp_optwithDateTime::from_timestamp(raises the chrono floor to 0.4.31). Output is identical.
lifetimes, drop a dead
scale_flagcheck, tidy tests and comments.Adds a test pinning ATDF timestamp and empty-
KxCfbehavior. 9 commits,each builds on its own. Run CI with
--all-featuresto cover the zip path.