Skip to content

Commit 693234b

Browse files
committed
resolve clippy warnings
- unneeded return statement - swap iter().colned().collect() with to_vec()
1 parent 04483e5 commit 693234b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plotters/src/style/colors/colormaps.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ impl<ColorType: crate::style::Color + Clone> DerivedColorMap<ColorType> {
4141
/// This function lets the user define a new colormap by simply specifying colors in the correct order.
4242
/// For calculation of the color values, the colors will be spaced evenly apart.
4343
pub fn new(colors: &[ColorType]) -> Self {
44-
DerivedColorMap { colors: colors.iter().cloned().collect() }
44+
DerivedColorMap {
45+
colors: colors.to_vec(),
46+
}
4547
}
4648
}
4749

@@ -98,7 +100,7 @@ fn calculate_relative_difference_index_lower_upper<
98100
let index_upper = approximate_index.ceil().to_usize().unwrap();
99101
// Calculate the relative difference, ie. is the actual value more towards the color of index_upper or index_lower?
100102
let relative_difference = approximate_index.ceil() - approximate_index;
101-
return (relative_difference, index_lower, index_upper);
103+
(relative_difference, index_lower, index_upper)
102104
}
103105

104106
macro_rules! implement_color_scale_for_derived_color_map{

0 commit comments

Comments
 (0)