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

Fix clippy issues #52

Closed
jfrimmel opened this issue Feb 24, 2022 · 0 comments · Fixed by #66
Closed

Fix clippy issues #52

jfrimmel opened this issue Feb 24, 2022 · 0 comments · Fixed by #66
Labels
good first issue Good for newcomers

Comments

@jfrimmel
Copy link
Owner

Currently each PR has the following issue, which should be fixed:

Output of cargo clippy

    Checking cargo-valgrind v2.0.2 (/home/runner/work/cargo-valgrind/cargo-valgrind)
warning: consider adding a `;` to the last statement for consistent formatting
  --> src/panic.rs:76:13
   |
76 |             old_hook(panic)
   |             ^^^^^^^^^^^^^^^ help: add a `;` here: `old_hook(panic);`
   |
note: the lint level is defined here
  --> src/main.rs:9:5
   |
9  |     clippy::pedantic,
   |     ^^^^^^^^^^^^^^^^
   = note: `#[warn(clippy::semicolon_if_nothing_returned)]` implied by `#[warn(clippy::pedantic)]`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

warning: this `impl` can be derived
   --> src/valgrind/xml/mod.rs:156:1
    |
156 | / impl Default for Resources {
157 | |     fn default() -> Self {
158 | |         Resources {
159 | |             bytes: 0,
...   |
162 | |     }
163 | | }
    | |_^
    |
note: the lint level is defined here
   --> src/main.rs:6:5
    |
6   |     clippy::complexity,
    |     ^^^^^^^^^^^^^^^^^^
    = note: `#[warn(clippy::derivable_impls)]` implied by `#[warn(clippy::complexity)]`
    = help: try annotating `valgrind::xml::Resources` with `#[derive(Default)]`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls

warning: unnecessary structure name repetition
   --> src/valgrind/xml/mod.rs:158:9
    |
158 |         Resources {
    |         ^^^^^^^^^ help: use the applicable keyword: `Self`
    |
note: the lint level is defined here
   --> src/main.rs:8:5
    |
8   |     clippy::nursery,
    |     ^^^^^^^^^^^^^^^
    = note: `#[warn(clippy::use_self)]` implied by `#[warn(clippy::nursery)]`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self

warning: length comparison to zero
  --> src/valgrind/mod.rs:87:24
   |
87 |                     if new_err.len() > 0 {
   |                        ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!new_err.is_empty()`
   |
note: the lint level is defined here
  --> src/main.rs:7:5
   |
7  |     clippy::style,
   |     ^^^^^^^^^^^^^
   = note: `#[warn(clippy::len_zero)]` implied by `#[warn(clippy::style)]`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero

warning: consider adding a `;` to the last statement for consistent formatting
  --> src/valgrind/mod.rs:88:25
   |
88 |                         output.errors = Some(new_err)
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `output.errors = Some(new_err);`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

warning: consider adding a `;` to the last statement for consistent formatting
  --> src/valgrind/mod.rs:90:25
   |
90 |                         output.errors = None
   |                         ^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `output.errors = None;`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

warning: `cargo-valgrind` (bin "cargo-valgrind") generated 6 warnings
    Finished dev [unoptimized + debuginfo] target(s) in 1m 10s

If your PR introduced these issues, please try to address them.

Originally posted by @github-actions[bot] in #50 (comment)

@jfrimmel jfrimmel added the good first issue Good for newcomers label Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant