Skip to content

Conversation

@echobt
Copy link
Contributor

@echobt echobt commented Feb 4, 2026

Changes

  • Replace 3.14 with 3.125 in test assertions to avoid clippy's approx_constant lint
  • This prevents false positives where clippy incorrectly suggests using std::f64::consts::PI when we're just testing with arbitrary decimal values

Testing

  • All cargo tests pass
  • Clippy passes with no errors
  • Project compiles successfully

Verification

cargo check --all          # Passes
cargo test --all           # Passes  
cargo clippy --all --all-targets  # Passes (no errors)
cargo fmt --all --check    # Passes

Summary by CodeRabbit

  • Tests
    • Updated test expectations for floating-point number handling to reflect actual values.

@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

This PR updates test expectations in two files, changing expected floating-point values from 3.14 to 3.125 across tests for JSON canonicalization and storage value conversions. No production code or public APIs are modified.

Changes

Cohort / File(s) Summary
Test Expectations
crates/distributed-storage/src/submission.rs, crates/storage/src/types.rs
Updated test expected values from 3.14 to 3.125 for floating-point number handling in JSON canonicalization and StorageValue f64 conversions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Three point one-four meets three point one-two-five,
A floating-point correction helps tests survive,
No logic bends, no code does change,
Just numbers shifting—perfectly arranged! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: replacing test literals (3.14 with 3.125) to avoid clippy's approx_constant lint.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/clippy-approx-constant

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@echobt echobt merged commit d7a46e3 into main Feb 4, 2026
7 checks passed
@echobt echobt deleted the fix/clippy-approx-constant branch February 4, 2026 17:39
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.

1 participant