Skip to content

Commit

Permalink
Fix current CI (#123)
Browse files Browse the repository at this point in the history
* temporary allow windows target to fails

* change clippy flag cyclomatic_complexity -> cognitive_complexity

* fix clippy warning: casting integer literal to f32 is unnecessary
  • Loading branch information
Andrii Radyk authored and jonhoo committed Apr 14, 2019
1 parent 3d549ff commit b76aaf9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ if: type != push OR (tag IS blank AND branch = master)
jobs:
allow_failures:
- rust: nightly
# Temporary ignored: see PR#123: https://github.com/jonhoo/inferno/pull/123/files
- os: windows
include:
- stage: check # do a pre-screen to make sure this is even worth testing
script: cargo check --all-targets
Expand Down
26 changes: 15 additions & 11 deletions src/flamegraph/color/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ fn namehash<I: Iterator<Item = u8>>(mut name: I) -> f32 {

macro_rules! t {
($b:expr, $a:expr, $x:expr) => {
$b + ($a as f32 * $x) as u8
$b + ($a * $x) as u8
};
}

Expand All @@ -311,16 +311,20 @@ fn rgb_components_for_palette(palette: Palette, name: &str, v1: f32, v2: f32, v3
};

match basic_palette {
BasicPalette::Hot => color!(t!(205, 50, v3), t!(0, 230, v1), t!(0, 55, v2)),
BasicPalette::Mem => color!(t!(0, 0, v3), t!(190, 50, v2), t!(0, 210, v1)),
BasicPalette::Io => color!(t!(80, 60, v1), t!(80, 60, v1), t!(190, 55, v2)),
BasicPalette::Red => color!(t!(200, 55, v1), t!(50, 80, v1), t!(50, 80, v1)),
BasicPalette::Green => color!(t!(50, 60, v1), t!(200, 55, v1), t!(50, 60, v1)),
BasicPalette::Blue => color!(t!(80, 60, v1), t!(80, 60, v1), t!(205, 50, v1)),
BasicPalette::Yellow => color!(t!(175, 55, v1), t!(175, 55, v1), t!(50, 20, v1)),
BasicPalette::Purple => color!(t!(190, 65, v1), t!(80, 60, v1), t!(190, 65, v1)),
BasicPalette::Aqua => color!(t!(50, 60, v1), t!(165, 55, v1), t!(165, 55, v1)),
BasicPalette::Orange => color!(t!(190, 65, v1), t!(90, 65, v1), t!(0, 0, v1)),
BasicPalette::Hot => color!(t!(205, 50_f32, v3), t!(0, 230_f32, v1), t!(0, 55_f32, v2)),
BasicPalette::Mem => color!(t!(0, 0_f32, v3), t!(190, 50_f32, v2), t!(0, 210_f32, v1)),
BasicPalette::Io => color!(t!(80, 60_f32, v1), t!(80, 60_f32, v1), t!(190, 55_f32, v2)),
BasicPalette::Red => color!(t!(200, 55_f32, v1), t!(50, 80_f32, v1), t!(50, 80_f32, v1)),
BasicPalette::Green => color!(t!(50, 60_f32, v1), t!(200, 55_f32, v1), t!(50, 60_f32, v1)),
BasicPalette::Blue => color!(t!(80, 60_f32, v1), t!(80, 60_f32, v1), t!(205, 50_f32, v1)),
BasicPalette::Yellow => {
color!(t!(175, 55_f32, v1), t!(175, 55_f32, v1), t!(50, 20_f32, v1))
}
BasicPalette::Purple => {
color!(t!(190, 65_f32, v1), t!(80, 60_f32, v1), t!(190, 65_f32, v1))
}
BasicPalette::Aqua => color!(t!(50, 60_f32, v1), t!(165, 55_f32, v1), t!(165, 55_f32, v1)),
BasicPalette::Orange => color!(t!(190, 65_f32, v1), t!(90, 65_f32, v1), t!(0, 0_f32, v1)),
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/flamegraph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ impl Rectangle {
/// The resulting flame graph will be written out to `writer` in SVG format.
///
/// [differential flame graph]: http://www.brendangregg.com/blog/2014-11-09/differential-flame-graphs.html
#[allow(clippy::cyclomatic_complexity)]
#[allow(clippy::cognitive_complexity)]
pub fn from_lines<'a, I, W>(opt: &mut Options<'_>, lines: I, writer: W) -> quick_xml::Result<()>
where
I: IntoIterator<Item = &'a str>,
Expand Down

0 comments on commit b76aaf9

Please sign in to comment.