Skip to content

fix: resolve clippy warnings#10

Merged
flamestro merged 2 commits into
flamestro:mainfrom
hobostay:fix/clippy-warnings
Mar 6, 2026
Merged

fix: resolve clippy warnings#10
flamestro merged 2 commits into
flamestro:mainfrom
hobostay:fix/clippy-warnings

Conversation

@hobostay

@hobostay hobostay commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes all clippy warnings when running cargo clippy -- -D warnings.

Changes

  • src/diff.rs:
    • Collapse nested if statement with let-else chain (dotenv syntax detection)
    • Use ? operator for Option handling instead of let-else
  • src/render.rs:
    • Use char array in split() instead of manual char comparison
    • Add #[allow(clippy::too_many_arguments)] for functions with many parameters
  • src/terminal.rs:
    • Collapse nested if statements with let-else chains

Clippy Lints Fixed

  • collapsible-if (3 instances)
  • question-mark (1 instance)
  • manual-pattern-char-comparison (1 instance)
  • too-many-arguments (2 instances - addressed with allow attributes)

Verification

cargo clippy -- -D warnings

Now passes without any warnings.

- Collapse nested if statements with let-else chains
- Use ? operator for Option handling
- Use char array in split() instead of manual comparison
- Add #[allow(clippy::too_many_arguments)] for functions with many parameters

Fixes the following clippy lints:
- collapsible-if (3 instances)
- question-mark (1 instance)
- manual-pattern-char-comparison (1 instance)
- too-many-arguments (2 instances)
@flamestro

flamestro commented Mar 6, 2026

Copy link
Copy Markdown
Owner

Thanks for taking care of this!
Could you please run cargo fmt as well.

@hobostay

hobostay commented Mar 6, 2026

Copy link
Copy Markdown
Contributor Author

Done! I've run cargo fmt and pushed the changes.

@flamestro flamestro merged commit cf2efc9 into flamestro:main Mar 6, 2026
4 checks passed
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