Skip to content

refactor: resolve clippy lints in mock server and example#239

Merged
inureyes merged 1 commit into
mainfrom
fix/clippy-examples-mock
May 25, 2026
Merged

refactor: resolve clippy lints in mock server and example#239
inureyes merged 1 commit into
mainfrom
fix/clippy-examples-mock

Conversation

@inureyes

Copy link
Copy Markdown
Member

Summary

Resolves pre-existing clippy lints in the mock server and the library-usage example. These were surfaced by cargo clippy --all-targets --features mock (run by the local pre-commit hook) but are not caught by CI's default-target cargo clippy, so they had gone unnoticed. Discovered while working on #238.

Changes

  • src/mock/server.rsexplicit_counter_loop: replace the manual let mut instance_counter / instance_counter += 1 with for (instance_counter, port) in (args.start_index..).zip(port_range.clone()). Same numbering (starts at args.start_index, +1 per node), no behavior change.
  • examples/library_usage.rsuninlined_format_args: inline the simple identifiers original_index and total_gb into the println! format strings. Field-access args (e.g. held_cpu.cpu_model) stay positional since Rust inline format only supports bare identifiers.

Verification

  • cargo clippy --all-targets --features mock -- -D warningsclean (exit 0, 0 warnings).
  • cargo fmt --check → clean.
  • No behavior change (pure lint/style fixes).

These lints are surfaced by `cargo clippy --all-targets --features mock`
(as run by the local pre-commit hook) but are not caught by CI's
default-target clippy, so they had accumulated unnoticed.

- src/mock/server.rs: replace the manual `instance_counter` with a
  `(args.start_index..).zip(port_range)` counter (explicit_counter_loop).
- examples/library_usage.rs: inline `original_index` / `total_gb` into the
  format strings (uninlined_format_args).

No behavior change. `cargo clippy --all-targets --features mock -- -D warnings`
is now clean.
@inureyes inureyes added the type:refactor Code refactoring label May 25, 2026
@inureyes inureyes merged commit 684d100 into main May 25, 2026
4 checks passed
@inureyes inureyes deleted the fix/clippy-examples-mock branch May 25, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant