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

Resolve "noop_method_call" warnings for rust 1.73+ #113

Merged
merged 1 commit into from Oct 19, 2023

Conversation

who-biz
Copy link
Contributor

@who-biz who-biz commented Oct 16, 2023

  • Rust compiler added warnings to noop method calls (redundant calls that do nothing)
  • These changes take rust compiler recommendations and accomodate them to silence warnings

Compiler output prior to these changes is as follows:

warning: call to `.clone()` on a reference in this situation does nothing
   --> servers/src/epic/server.rs:188:26
    |
188 |         fs::create_dir_all(path.clone())?;
    |                                ^^^^^^^^ help: remove this redundant call
    |
    = note: the type `Path` does not implement `Clone`, so calling `clone` on `&Path` 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
   --> config/src/config.rs:247:17
    |
247 |   ...                   .unwrap()
    |  ________________________________^
248 | | ...                   .clone(),
    | |______________________________^ help: remove this redundant call
    |
    = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` 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/bin/epic.rs:103:56
    |
103 |         let url = taxes_args.value_of("from_wallet").unwrap().clone();
    |                                                              ^^^^^^^^ help: remove this redundant call
    |
    = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed
    = note: `#[warn(noop_method_call)]` on by default

These warnings are now resolved.

- Rust compiler added warnings to noop method calls (redundant calls that do nothing)
- These changes take rust compiler recommendations and accomodate them to silence warnings
@who-biz who-biz merged commit 74c746e into EpicCash:master Oct 19, 2023
1 check passed
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.

None yet

3 participants