Fix all clippy warnings and format code with cargo fmt #247
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR resolves all clippy warnings when running
cargo clippy --workspace --all-targets -- -D warningsand formats the codebase usingcargo fmt.Issues Fixed
Non-local Implementation Definitions
Moved
impl Environment for TestEnvironmentblocks outside of functions in test files to comply with Rust's scoping rules:crates/pet-poetry/tests/common.rscrates/pet-pyenv/tests/common.rscrates/pet-conda/tests/common.rsPointer Argument Optimizations
Replaced
&Stringparameters with&strfor better performance and idiomatic Rust:crates/pet/tests/common.rs: Functionsdoes_version_match,get_version,is_valid_versioncrates/pet-conda/tests/ci_test.rs: Functionget_versionField Assignment Improvements
Replaced field assignments on
Default::default()with struct initialization syntax:crates/pet/tests/ci_test.rs: Configuration objects (2 instances)crates/pet/tests/ci_poetry.rs: Configuration objects (2 instances)Code Deduplication
Combined identical conditional blocks that had the same behavior for known issues:
crates/pet/tests/ci_test.rs: Merged duplicate error handling for GitHub issue Issues with detection of Python on codespaces #64Unnecessary Code Removal
..Default::default()syntax where all struct fields were explicitly specified incrates/pet-pyenv/tests/pyenv_test.rsreturnstatement incrates/pet/tests/ci_test.rscrates/pet-poetry/tests/config_test.rsConfiguration Fix
Added missing
cifeature tocrates/pet-poetry/Cargo.tomlto resolve unexpected cfg condition warnings for CI-related conditional compilation.Verification
All changes maintain existing functionality while improving code quality and performance. The build now passes cleanly with:
Code has been formatted consistently across the workspace using
cargo fmt --all.Created from VS Code via the GitHub Pull Request extension.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.