Skip to content

fix: address clippy warnings to improve code quality #400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

GarmashAlex
Copy link

@GarmashAlex GarmashAlex commented May 4, 2025

Description

This PR addresses several Clippy warnings throughout the codebase to improve code quality and readability:

  1. In constraint_system_ref.rs, replaced map(|x| x.clone()) with more idiomatic cloned() method
  2. In instance_outliner.rs, introduced a type alias InstanceOutliningFunction<F> for the complex function type to improve code readability
  3. In constraint_system.rs, replaced map().flatten() pattern with the more efficient and_then() method
  4. In variable.rs, fixed non-canonical implementation of PartialOrd for Variable by using the canonical pattern that leverages the already implemented Ord trait
  5. In snark/src/lib.rs, introduced a type alias IndexResult for the complex return type in the UniversalSetupSNARK trait

These changes make the code more idiomatic, more readable, and follow Rust best practices. The changes are purely refactoring and don't affect functionality.

closes: #XXXX


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (master)
  • Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

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