Skip to content

fix: add missing #[must_use] attributes to fix clippy errors - #125

Merged
pando85 merged 1 commit into
masterfrom
fix/ci-must-use-clippy
Nov 13, 2026
Merged

pando85 merged 1 commit into
masterfrom
fix/ci-must-use-clippy

Conversation

@forkline

@forkline forkline Bot commented Nov 13, 2026

Copy link
Copy Markdown

Summary

Added #[must_use] attributes to three methods in src/error.rs that were causing clippy must_use_candidate lint errors (denied via -D warnings):

  • is_rate_limited()
  • is_transient_hcloud()
  • target_already_defined()

These methods return bool and should have #[must_use] per clippy's recommendation.

Fixes CI failure on commit f8cffdb.


*This PR was generated by Forkline — AI-powered code contributions.
The agent analyzed the issue and implemented this fix autonomously.

Add #[must_use] to is_rate_limited, is_transient_hcloud, and
target_already_defined methods in src/error.rs to satisfy
clippy::must_use_candidate lint (denied via -D warnings).
@forkline

forkline Bot commented Nov 13, 2026

Copy link
Copy Markdown
Author

Maintainability Review

Initial expected implementation: matched
Initial reason: PR description lists three methods needing #[must_use]; all three are present in the diff.
Applied maintenance work: none
Final implementation: matches
Validation: cargo clippy --all-targets --all-features -- -D warnings passes clean; cargo test — 117 passed, 0 failed.


Finding 1

  • Priority: low
  • Category: implementation gap
  • Decision: do not pursue
  • Location: src/error.rs — private free functions is_rate_limit() (line 12) and is_transient_hcloud() (line 200)
  • Problem: These are pure bool-returning helpers that could theoretically also trigger must_use_candidate, but clippy's pedantic lint does not flag private functions used only within their module.
  • Action: No change needed.
  • Why it is worth it: N/A — clippy already passes without it.
  • Risk / scope: N/A

Finding 2

  • Priority: low
  • Category: test
  • Decision: do not pursue
  • Location: src/error.rs — is_rate_limited(), is_transient_hcloud(), target_already_defined()
  • Problem: No dedicated unit tests for these three query methods. They are exercised indirectly through reconciliation tests, but edge cases (e.g., non-429 status codes, robot_unavailable error code matching) are not directly verified.
  • Action: Consider adding unit tests in a future change if these methods gain complexity.
  • Why it is worth it: Low — the methods are simple pattern matches and the integration tests cover the main paths. Not worth blocking this PR.
  • Risk / scope: Low risk, but low urgency.

@pando85
pando85 merged commit 36997aa into master Nov 13, 2026
3 checks passed
@pando85
pando85 deleted the fix/ci-must-use-clippy branch November 13, 2026 08:03
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