Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unnecessary-get-then-check clippy warning #100

Merged
merged 1 commit into from
May 16, 2024
Merged

Conversation

DeltaEvo
Copy link
Collaborator

error: unnecessary use of get(f.id().unwrap()).is_none()
--> pdl-compiler/src/backends/rust/mod.rs:93:37
|
93 | .filter(|f| all_constraints.get(f.id().unwrap()).is_none())
| ----------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: replace it with: !all_constraints.contains_key(f.id().unwrap())
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
= note: -D clippy::unnecessary-get-then-check implied by -D warnings
= help: to override -D warnings add #[allow(clippy::unnecessary_get_then_check)]

error: unnecessary use of get(f.id().unwrap()).is_some()
--> pdl-compiler/src/backends/rust/mod.rs:111:37
|
111 | .filter(|f| all_constraints.get(f.id().unwrap()).is_some())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: contains_key(f.id().unwrap())
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check

error: unnecessary use of `get(f.id().unwrap()).is_none()`
  --> pdl-compiler/src/backends/rust/mod.rs:93:37
   |
93 |         .filter(|f| all_constraints.get(f.id().unwrap()).is_none())
   |                     ----------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |                     |
   |                     help: replace it with: `!all_constraints.contains_key(f.id().unwrap())`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
   = note: `-D clippy::unnecessary-get-then-check` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::unnecessary_get_then_check)]`

error: unnecessary use of `get(f.id().unwrap()).is_some()`
   --> pdl-compiler/src/backends/rust/mod.rs:111:37
    |
111 |         .filter(|f| all_constraints.get(f.id().unwrap()).is_some())
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(f.id().unwrap())`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
@DeltaEvo DeltaEvo requested a review from hchataing May 16, 2024 00:05
@DeltaEvo DeltaEvo merged commit d1a2dc0 into main May 16, 2024
8 checks passed
@DeltaEvo DeltaEvo deleted the david/fix_clippy branch May 16, 2024 00:42
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.

2 participants