Skip to content

fix: resolve needless_late_init lints flagged by newer clippy - #16

Merged
huxulm merged 3 commits into
mainfrom
claude/rust-project-config-standardization-7ymogg
Oct 24, 2026
Merged

huxulm merged 3 commits into
mainfrom
claude/rust-project-config-standardization-7ymogg

Conversation

@huxulm

@huxulm huxulm commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Summary

The Clippy job in CI fails on main (run https://github.com/astro-xao/sofars/actions/runs/40114912999). CI installs the latest stable toolchain (Rust 1.99), whose clippy reports needless_late_init in five places. With -D warnings these are errors:

  • src/astro/refco.rs — pw, gamma
  • src/cal/jdcalf.rs — j, denom
  • src/eph/moon98.rs — en, den (longitude and latitude loops)

Each one now binds its value directly from the if/match expression instead of declaring the variable first and assigning it in each branch. The logic is unchanged.

Testing

On Rust 1.99 (the version CI uses):

  • cargo fmt --check ✅
  • cargo clippy --all-targets -- -D warnings ✅
  • cargo test ✅ (all test suites and doctests pass)
  • MSRV: cargo +1.85 check --lib ✅

Generated by Claude Code

- Add CI workflow running rustfmt, clippy (-D warnings), tests,
  doctests and an MSRV check.
- Cargo.toml: add rust-version (1.85), categories, package excludes,
  and a [lints] table that allows clippy lints inherent to a faithful
  SOFA port (long argument lists, full-precision literals, index loops,
  SOFA-style doc layout, NaN-sensitive range checks).
- Fix doctests: mark SOFA text tables/formulas in doc comments as
  `text` blocks so rustdoc no longer compiles them (291 failing -> 0).
- Fix clippy errors/warnings: use std PI/TAU for DPI/D2PI (same f64
  values), apply safe auto-fixes, rename private CamelCase structs,
  keep max/min in refco to preserve SOFA NaN handling.
- Run cargo fmt over the whole crate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y4qZWR3v6eu28sGykfJCtY
CI runs the latest stable toolchain (1.99), whose clippy reports
needless_late_init in refco, jdcalf and moon98. Bind the values
directly from the if/match expressions instead of declaring them
first. No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y4qZWR3v6eu28sGykfJCtY
…ardization-7ymogg' into claude/rust-project-config-standardization-7ymogg

# Conflicts:
#	src/astro/refco.rs
@huxulm
huxulm merged commit 669bd03 into main Oct 24, 2026
4 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 24, 2026
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