Skip to content

style(clippy): wrap constant assertions in const blocks in safeoutputs/mod.rs#695

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
clippy-fixer-safeoutputs-mod-assertions-1ad2a792c903b773
Draft

style(clippy): wrap constant assertions in const blocks in safeoutputs/mod.rs#695
github-actions[bot] wants to merge 1 commit into
mainfrom
clippy-fixer-safeoutputs-mod-assertions-1ad2a792c903b773

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

What clippy found

Clipper reported 23 assertions_on_constants errors and 1 let_and_return error in src/safeoutputs/mod.rs:

error: this assertion has a constant value
   --> src/safeoutputs/mod.rs:843:9
    |
843 |         assert!(CreateWorkItemResult::REQUIRES_WRITE);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider moving this into a const block: `const { assert!(..) }`

error: returning the result of a `let` binding from a block
    --> src/safeoutputs/mod.rs:1198:9
    |
1193 |         let ctx = ExecutionContext { ... };
1198 |         ctx
    = help: return the expression directly

How it was fixed

  • assertions_on_constants (23×) — wrapped every assert!(CONST) and assert!(!CONST) in the test_requires_write_consistency test with const { ... } blocks as suggested.
  • let_and_return (1×) — removed the intermediate ctx binding in ctx_with and returned the ExecutionContext struct literal directly.

Files touched: src/safeoutputs/mod.rs

Verification

  • cargo build --all-targets
  • cargo test
  • cargo clippy --all-targets --all-features --workspace -- -D warnings — no errors in src/safeoutputs/mod.rs

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 · ● 6.8M ·

…s/mod.rs

Also drop unnecessary let binding in ctx_with helper (let_and_return).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot mentioned this pull request May 22, 2026
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