Skip to content

Release 0.11.21

Release 0.11.21 #207

GitHub Actions / clippy succeeded Aug 3, 2024 in 0s

clippy

10 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 10
Note 0
Help 0

Versions

  • rustc 1.80.0 (051478957 2024-07-21)
  • cargo 1.80.0 (376290515 2024-07-16)
  • clippy 0.1.80 (0514789 2024-07-21)

Annotations

Check warning on line 919 in src/flamegraph/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/flamegraph/mod.rs:919:21
    |
919 |     svg.write_event(&cache_rect)
    |                     ^^^^^^^^^^^ help: change this to: `cache_rect`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 769 in src/flamegraph/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/flamegraph/mod.rs:769:25
    |
769 |         svg.write_event(&cache_g)?;
    |                         ^^^^^^^^ help: change this to: `cache_g`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 762 in src/flamegraph/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/flamegraph/mod.rs:762:29
    |
762 |             svg.write_event(&cache_g)?;
    |                             ^^^^^^^^ help: change this to: `cache_g`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

Check warning on line 758 in src/flamegraph/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/flamegraph/mod.rs:758:29
    |
758 |             svg.write_event(&cache_a)?;
    |                             ^^^^^^^^ help: change this to: `cache_a`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
    = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default

Check warning on line 620 in src/flamegraph/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant guard

warning: redundant guard
   --> src/flamegraph/mod.rs:620:32
    |
620 |                 Some(delta) if delta == 0 => write!(
    |                                ^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards
    = note: `#[warn(clippy::redundant_guards)]` on by default
help: try
    |
620 -                 Some(delta) if delta == 0 => write!(
620 +                 Some(0) => write!(
    |

Check warning on line 395 in src/flamegraph/color/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric constant

warning: usage of a legacy numeric constant
   --> src/flamegraph/color/mod.rs:395:36
    |
395 |         let hash3 = (hash as f64 / std::u64::MAX as f64) as f32;
    |                                    ^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
    |
395 |         let hash3 = (hash as f64 / u64::MAX as f64) as f32;
    |                                    ~~~~~~~~

Check warning on line 392 in src/flamegraph/color/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric constant

warning: usage of a legacy numeric constant
   --> src/flamegraph/color/mod.rs:392:36
    |
392 |         let hash2 = (hash as f64 / std::u64::MAX as f64) as f32;
    |                                    ^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
    |
392 |         let hash2 = (hash as f64 / u64::MAX as f64) as f32;
    |                                    ~~~~~~~~

Check warning on line 387 in src/flamegraph/color/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric constant

warning: usage of a legacy numeric constant
   --> src/flamegraph/color/mod.rs:387:36
    |
387 |         let hash1 = (hash as f64 / std::u64::MAX as f64) as f32;
    |                                    ^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    = note: `#[warn(clippy::legacy_numeric_constants)]` on by default
help: use the associated constant instead
    |
387 |         let hash1 = (hash as f64 / u64::MAX as f64) as f32;
    |                                    ~~~~~~~~

Check warning on line 104 in src/flamegraph/color/palette_map.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

file opened with `create`, but `truncate` behavior not defined

warning: file opened with `create`, but `truncate` behavior not defined
   --> src/flamegraph/color/palette_map.rs:104:55
    |
104 |         let mut file = OpenOptions::new().write(true).create(true).open(path)?;
    |                                                       ^^^^^^^^^^^^- help: add: `.truncate(true)`
    |
    = help: if you intend to overwrite an existing file entirely, call `.truncate(true)`
    = help: if you instead know that you may want to keep some parts of the old file, call `.truncate(false)`
    = help: alternatively, use `.append(true)` to append to the file instead of overwriting it
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options
    = note: `#[warn(clippy::suspicious_open_options)]` on by default

Check warning on line 556 in src/collapse/perf.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `if` statement can be collapsed

warning: this `if` statement can be collapsed
   --> src/collapse/perf.rs:549:24
    |
549 |                   } else if self.opt.annotate_jit
    |  ________________________^
550 | |                     && ((module.starts_with("/tmp/perf-") && module.ends_with(".map"))
551 | |                         || (module.contains("/jitted-") && module.ends_with(".so")))
552 | |                 {
...   |
555 | |                     }
556 | |                 }
    | |_________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
    = note: `#[warn(clippy::collapsible_if)]` on by default
help: collapse nested if block
    |
549 ~                 } else if self.opt.annotate_jit && ((module.starts_with("/tmp/perf-") && module.ends_with(".map"))
550 +                         || (module.contains("/jitted-") && module.ends_with(".so"))) && !func.contains("_[j]") {
551 +                     func.push_str("_[j]"); // jitted
552 +                 }
    |