Skip to content

Comments

refactor: Clippy#246

Open
mhovd wants to merge 1 commit intomainfrom
clippy
Open

refactor: Clippy#246
mhovd wants to merge 1 commit intomainfrom
clippy

Conversation

@mhovd
Copy link
Collaborator

@mhovd mhovd commented Feb 19, 2026

Minor changes

Copilot AI review requested due to automatic review settings February 19, 2026 10:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses Clippy lint warnings by making the code more idiomatic and concise. The changes include adding the is_empty() method to the Weights struct and simplifying loop patterns used in algorithm execution.

Changes:

  • Added is_empty() method to Weights struct to complement existing len() method
  • Refactored algorithm fitting loops from explicit match statements to more concise while let patterns
  • Simplified return statement in fit() method by removing redundant Ok() wrapper

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/structs/weights.rs Added is_empty() method to satisfy Clippy's len_without_is_empty lint
src/bestdose/posterior.rs Refactored NPAG optimization loop to use while let pattern instead of explicit match
src/algorithms/mod.rs Refactored algorithm fitting loop and simplified return statement

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

🐰 Bencher Report

Branchclippy
Testbedmhovd-pgx

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
bimodal_ke_npag📈 view plot
⚠️ NO THRESHOLD
5,076.00 ms
bimodal_ke_npod📈 view plot
⚠️ NO THRESHOLD
1,664.50 ms
bimodal_ke_postprob📈 view plot
⚠️ NO THRESHOLD
429.39 ms
🐰 View full continuous benchmarking report in Bencher

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