Skip to content

style(clippy): use struct update syntax for field_reassign_with_default#679

Merged
jamesadevine merged 1 commit into
mainfrom
clippy-fixer/field-reassign-with-default-65c8c4d08e5dfa86
May 21, 2026
Merged

style(clippy): use struct update syntax for field_reassign_with_default#679
jamesadevine merged 1 commit into
mainfrom
clippy-fixer/field-reassign-with-default-65c8c4d08e5dfa86

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

What clippy found

clippy::field_reassign_with_default fired in 3 files:

error: field assignment outside of initializer for an instance created with Default::default()
   --> src/agent_stats.rs:382:9
   --> src/agent_stats.rs:403:9
   --> src/execute.rs:1326:9
   --> src/execute.rs:1356:9
   --> src/execute.rs:1447:9
   --> src/safeoutputs/mod.rs:1194:9

How it was fixed

Lint: clippy::field_reassign_with_default
Fix: Replace let mut x = T::default(); x.field = val; with let x = T { field: val, ..Default::default() };

Files touched:

  • src/agent_stats.rs — 2 test helpers
  • src/execute.rs — 3 test helpers
  • src/safeoutputs/mod.rs — 1 test helper

Verification

cargo build --all-targets
cargo test
cargo clippy --all-targets --all-features --workspace -- -D warnings ✅ (no field_reassign_with_default errors remain)

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • dev.azure.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "dev.azure.com"

See Network Configuration for more information.

Generated by Clippy Fixer · ● 10.6M ·

Fix clippy::field_reassign_with_default in agent_stats.rs, execute.rs,
and safeoutputs/mod.rs by initializing ExecutionContext using struct
update syntax instead of post-initialization field assignment.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamesadevine jamesadevine marked this pull request as ready for review May 21, 2026 06:43
@jamesadevine jamesadevine merged commit 1379c79 into main May 21, 2026
@jamesadevine jamesadevine deleted the clippy-fixer/field-reassign-with-default-65c8c4d08e5dfa86 branch May 21, 2026 06:43
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