Skip to content

Commit

Permalink
Fix some clippy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémi Lauzier committed Jun 11, 2021
1 parent 0893b39 commit d765c77
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions palette/build/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub fn build_gradients(writer: &mut File) {
.next()
.unwrap_or_else(|| panic!("less lines than stated colors in gradient {}", name))
.unwrap_or_else(|_| panic!("couldn't read the {}th line of color {}", i, name));
let mut rgb = color.split(",");
let mut rgb = color.split(',');
let red: f32 = rgb
.next()
.and_then(|r| r.trim().parse().ok())
Expand All @@ -95,7 +95,7 @@ pub fn build_gradients(writer: &mut File) {
.unwrap_or_else(|| panic!("couldn't get the {}th blue-value for {}", i, name));
write!(writer, "({:.10},{}{{red: {}, green: {}, blue: {}, standard: ::core::marker::PhantomData}}),", (i as f32/number_of_colors as f32), color_type, red, green, blue).unwrap();
}
write!(writer, "], ::core::marker::PhantomData);\n").unwrap();
writeln!(writer, "], ::core::marker::PhantomData);").unwrap();
}
}

Expand Down
2 changes: 1 addition & 1 deletion palette/src/lch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ where
Lch {
l: color.l,
chroma: (color.a * color.a + color.b * color.b).sqrt(),
hue: color.get_hue().unwrap_or(LabHue::from(T::zero())),
hue: color.get_hue().unwrap_or_else(|| LabHue::from(T::zero())),
white_point: PhantomData,
}
}
Expand Down
2 changes: 1 addition & 1 deletion palette/src/lchuv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ where
Lchuv {
l: color.l,
chroma: color.u.hypot(color.v),
hue: color.get_hue().unwrap_or(LuvHue::from(T::zero())),
hue: color.get_hue().unwrap_or_else(|| LuvHue::from(T::zero())),
white_point: PhantomData,
}
}
Expand Down

0 comments on commit d765c77

Please sign in to comment.