Neptune-Crypto / neptune-core

anonymous peer-to-peer cash
Apache License 2.0
25 stars 7 forks source link

Linting problem when committing new changes #155

Closed elielnfinic closed 2 months ago

elielnfinic commented 4 months ago

Hi everyone,

I am facing an issue when I try to commit changes because of this linting issue.

I can see that it has been marked as a TODO. Can someone fix this or how should I commit ?

// TODO: Not sure how to handle this linting problem, as clippy suggestion doesn't work.

Here is what I get after running cargo clippy

    Checking neptune-core v0.0.5 (/Users/monordi/apps/neptune-core)
warning: unknown lint: `clippy::assigning_clones`
   --> src/bin/dashboard_src/receive_screen.rs:193:21
    |
193 |             #[allow(clippy::assigning_clones)]
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(unknown_lints)]` on by default

warning: unknown lint: `clippy::assigning_clones`
   --> src/bin/dashboard_src/send_screen.rs:355:21
    |
355 |             #[allow(clippy::assigning_clones)]
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^

warning: `neptune-core` (bin "neptune-dashboard") generated 2 warnings
    Finished dev [unoptimized + debuginfo] target(s) in 14.61s

Thank you.

dan-da commented 4 months ago

@elielnfinic what version of rust toolchain are you using? This lint was added in 1.78.0. rustup update will likely solve your issue.

If not, you can force a commit with git commit -n to skip the local checks. CI will still flag any problems when you create a PR.

As for the lint itself, previously I recall there were some issues reported about it, so it doesn't seem fullly baked yet and gives wrong suggestions / false positives.

dan-da commented 4 months ago

yeah, it seems the assigning_clones lint has recently been moved into the pedantic lints, due to some complaints it harms readability (I agree). We had discussed about disabling it ourselves anyway.