Skip to content

Commit

Permalink
Resolve noop_method_call warnings
Browse files Browse the repository at this point in the history
These warnings have newly appeared in Rust 1.73.0.

    warning: call to `.clone()` on a reference in this situation does nothing
       --> src/compile.rs:384:45
        |
    384 | ...                   Some(typ_element.clone()),
        |                                       ^^^^^^^^ help: remove this redundant call
        |
        = note: the type `TypeElement` does not implement `Clone`, so calling `clone` on `&TypeElement` copies the reference, which does not do anything and can be removed
        = note: `#[warn(noop_method_call)]` on by default

    warning: call to `.clone()` on a reference in this situation does nothing
       --> src/compile.rs:401:53
        |
    401 | ...                   Some(typ_element.clone()),
        |                                       ^^^^^^^^ help: remove this redundant call
        |
        = note: the type `TypeElement` does not implement `Clone`, so calling `clone` on `&TypeElement` copies the reference, which does not do anything and can be removed

    warning: call to `.clone()` on a reference in this situation does nothing
        --> src/compile.rs:1360:38
         |
    1360 |                     Some(type_element.clone()),
         |                                      ^^^^^^^^ help: remove this redundant call
         |
         = note: the type `TypeElement` does not implement `Clone`, so calling `clone` on `&TypeElement` copies the reference, which does not do anything and can be removed

    warning: `auto_generate_cdp` (lib) generated 3 warnings (run `cargo fix --lib -p auto_generate_cdp` to apply 3 suggestions)
  • Loading branch information
dtolnay committed Nov 22, 2023
1 parent 28307e6 commit 13441ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ fn get_types(
get_types(
p_type,
PropertyType::Element(typ_element),
Some(typ_element.clone()),
Some(typ_element),
types,
enums,
objects,
Expand All @@ -398,7 +398,7 @@ fn get_types(
Some(p) => get_types(
p.clone(),
PropertyType::Param(property),
Some(typ_element.clone()),
Some(typ_element),
types,
enums,
objects,
Expand Down Expand Up @@ -1357,7 +1357,7 @@ pub fn compile_cdp_json(file_name: &str, commit: &str) -> (Vec<TokenStream>, Vec
get_types(
type_element.type_type,
PropertyType::Element(type_element),
Some(type_element.clone()),
Some(type_element),
&mut types,
&mut enums,
&mut objects,
Expand Down

0 comments on commit 13441ff

Please sign in to comment.