Skip to content

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

Merged
jamesadevine merged 1 commit into
mainfrom
clippy-fixer/assertions-on-constants-safeoutputs-mod-ecc81212383cd901
May 22, 2026
Merged

style(clippy): wrap constant assertions in const blocks in safeoutputs/mod.rs#689
jamesadevine merged 1 commit into
mainfrom
clippy-fixer/assertions-on-constants-safeoutputs-mod-ecc81212383cd901

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

What clippy found

Clippy 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
    |
    = help: return the expression directly

How it was fixed

  • clippy::assertions_on_constants (23 occurrences): Wrapped each assert!(SomeType::REQUIRES_WRITE) in a const { ... } block so the assertion is evaluated at compile time.
  • clippy::let_and_return (1 occurrence): Removed the intermediate let ctx = ...; ctx binding in ctx_with() and returned the struct expression directly.

Files touched: src/safeoutputs/mod.rs

Verification

  • cargo build --all-targets
  • cargo test
  • cargo clippy --all-targets --all-features --workspace -- -D warnings ✅ (these 24 errors are gone)

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.4M ·

…s/mod.rs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot mentioned this pull request May 22, 2026
@jamesadevine jamesadevine marked this pull request as ready for review May 22, 2026 13:28
@jamesadevine jamesadevine merged commit 92011fc into main May 22, 2026
@jamesadevine jamesadevine deleted the clippy-fixer/assertions-on-constants-safeoutputs-mod-ecc81212383cd901 branch May 22, 2026 13:28
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