Skip to content

style(clippy): use struct update syntax in create_work_item test - #2011

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
clippy-fixer-field-reassign-20260825-5db35a297c3bfcd4
Draft

style(clippy): use struct update syntax in create_work_item test#2011
github-actions[bot] wants to merge 1 commit into
mainfrom
clippy-fixer-field-reassign-20260825-5db35a297c3bfcd4

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

What clippy found

error: field assignment outside of initializer for an instance created with Default::default()
   --> src/safe_outputs/create_work_item.rs:991:9
    |
991 |         config.description_field = Some(AdoWorkItemFieldRef::parse("System.Title").unwrap());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: `-D clippy::field-reassign-with-default` implied by `-D warnings`

cargo clippy --all-targets --all-features --workspace -- -D warnings failed (exit 101) with this single finding in test_patch_field_validation_rejects_description_field_title_collision.

How it was fixed

  • Lint: clippy::field_reassign_with_default
  • Fix: replaced let mut config = CreateWorkItemConfig::default(); config.description_field = Some(...) with struct-update syntax (CreateWorkItemConfig { description_field: Some(...), ..Default::default() }), matching the pattern clippy suggests and avoids the redundant intermediate mutable default.
  • File touched: src/safe_outputs/create_work_item.rs (test-only change, 4 insertions / 2 deletions)

Verification

  • cargo build --all-targets — pass
  • cargo test — 3229 passed, 0 failed (plus all other integration test binaries green)
  • cargo clippy --all-targets --all-features --workspace -- -D warnings — exit 0, clean

Warning

Firewall blocked 1 domain

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

  • spsprodeus21.vssps.visualstudio.com

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

network:
  allowed:
    - defaults
    - "spsprodeus21.vssps.visualstudio.com"

See Network Configuration for more information.

Generated by Clippy Fixer · auto · 50.6 AIC · ⌖ 7.7 AIC · ⊞ 13.1K ·

Fixes clippy::field_reassign_with_default for
test_patch_field_validation_rejects_description_field_title_collision.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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.

0 participants