Skip to content

Commit

Permalink
Resolve unnecessary_get_then_check clippy lint
Browse files Browse the repository at this point in the history
    warning: unnecessary use of `get(resolved).is_some()`
       --> src/parse.rs:172:37
        |
    172 |                     if lookup.items.get(resolved).is_some() {
        |                                     ^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(resolved)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
        = note: `-W clippy::unnecessary-get-then-check` implied by `-W clippy::all`
        = help: to override `-W clippy::all` add `#[allow(clippy::unnecessary_get_then_check)]`
  • Loading branch information
dtolnay committed Feb 28, 2024
1 parent 018fc5a commit e06122b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion codegen/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ fn introspect_type(item: &syn::Type, lookup: &Lookup) -> types::Type {
while let Some(alias) = lookup.aliases.get(resolved) {
resolved = alias;
}
if lookup.items.get(resolved).is_some() {
if lookup.items.contains_key(resolved) {
types::Type::Syn(resolved.to_string())
} else {
unimplemented!("{}", resolved);
Expand Down

0 comments on commit e06122b

Please sign in to comment.