Skip to content

fix: replace bool comparison with negation to fix clippy lint error#951

Open
JiayuuWang wants to merge 1 commit intoRightNow-AI:mainfrom
JiayuuWang:contribot/fix-clippy-bool-comparison
Open

fix: replace bool comparison with negation to fix clippy lint error#951
JiayuuWang wants to merge 1 commit intoRightNow-AI:mainfrom
JiayuuWang:contribot/fix-clippy-bool-comparison

Conversation

@JiayuuWang
Copy link
Copy Markdown

Summary

Fixes the clippy lint error reported in #939.

cargo clippy --workspace --all-targets -- -D warnings fails with:

error: equality checks against false can be replaced by a negation
   --> crates/openfang-runtime/src/web_fetch.rs:517:17
    |
517 |         assert!(is_host_allowed("other.net", &allow) == false);
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!is_host_allowed("other.net", &allow)`
    |
    = note: `-D clippy::bool-comparison` implied by `-D warnings`

Change

Replace assert!(expr == false) with the idiomatic assert!(!expr) in the test_ssrf_allowlist_wildcard_domain test.

Closes #939

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.

Lint (clippy) error on crates/openfang-runtime/src/web_fetch.rs:517

1 participant