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

Clippy complains #3600

Closed
bernardnormier opened this issue Aug 19, 2023 · 5 comments
Closed

Clippy complains #3600

bernardnormier opened this issue Aug 19, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@bernardnormier
Copy link
Member

ZeroC pre-commit Hooks
Individual hooks can be enabled or disabled through git configuration: git config [--global] zeroc.hook.{{hookname}} true|false
- indentation
- whitespace
- license
- skipping dotnet-format (add to config to enable)
- clippy
    Checking slicec-cs v0.1.0 (/Users/bernard/builds/icerpc-csharp/tools/slicec-cs)
error: redundant clone
  --> src/cs_compile.rs:89:48
   |
89 |         slice_options.references.push(tests_dir.clone());
   |                                                ^^^^^^^^ help: remove this
   |
   = note: `-D clippy::redundant-clone` implied by `-D warnings`
note: this value is dropped without further use
  --> src/cs_compile.rs:89:39
   |
89 |         slice_options.references.push(tests_dir.clone());
   |                                       ^^^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone

error: could not compile `slicec-cs` due to previous error
- rustfmt

That's unrelated to my code. Why is this happening?

@bernardnormier bernardnormier added the bug Something isn't working label Aug 19, 2023
@externl
Copy link
Member

externl commented Aug 21, 2023

That's unrelated to my code. Why is this happening?

This linter runs over the whole repository.

@externl externl self-assigned this Aug 21, 2023
@externl
Copy link
Member

externl commented Aug 21, 2023

Weird, this lint is indeed valid however I can't reproduce this locally. What version of clippy do you have installed?

❯ cargo clippy -- --version
clippy 0.1.71 (eb26296b 2023-08-03)

@externl
Copy link
Member

externl commented Aug 21, 2023

Looks like as of 0.1.71 this is no longer a default lint. I guess the implementation is a little buggy.
rust-lang/rust-clippy#10940 (comment)

@bernardnormier
Copy link
Member Author

cargo clippy -- --version
clippy 0.1.65 (897e3755 2022-11-02)

@externl
Copy link
Member

externl commented Aug 21, 2023

cargo clippy -- --version
clippy 0.1.65 (897e3755 2022-11-02)

Ok, you should run rustup update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants