Skip to content

Fix clippy warnings - #22

Merged
noonchen merged 9 commits into
noonchen:mainfrom
henrik-nil-acc:fix-clippy
Jun 9, 2026
Merged

Fix clippy warnings#22
noonchen merged 9 commits into
noonchen:mainfrom
henrik-nil-acc:fix-clippy

Conversation

@henrik-nil-acc

Copy link
Copy Markdown
Contributor

cargo clippy --all-targets --all-features is now clean. No API changes,
no behavior changes except the chrono swap below.

  • Replace deprecated chrono from_timestamp_opt with DateTime::from_timestamp
    (raises the chrono floor to 0.4.31). Output is identical.
  • Simplify KxData/Dn readers, annotate the zip transmute and iterator
    lifetimes, drop a dead scale_flag check, tidy tests and comments.

Adds a test pinning ATDF timestamp and empty-KxCf behavior. 9 commits,
each builds on its own. Run CI with --all-features to cover the zip path.

@henrik-nil-acc

Copy link
Copy Markdown
Contributor Author

I used claude code to implement but have reviewed the changes and they look sane to me

@noonchen noonchen left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please confirm this file compiles

Comment thread example/stdf_to_xlsx.rs
@noonchen

noonchen commented Jun 9, 2026

Copy link
Copy Markdown
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!

@noonchen

noonchen commented Jun 9, 2026

Copy link
Copy Markdown
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.
@noonchen
noonchen merged commit c02a230 into noonchen:main Jun 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants