Skip to content

Commit 0dcb75a

Browse files
committed
use the newly introduced $crate syntax for macros
1 parent e59e6d5 commit 0dcb75a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

plotters/src/style/colors/colormaps.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ macro_rules! implement_color_scale_for_derived_color_map{
117117
self.colors.len()
118118
);
119119
// Interpolate the final color linearly
120-
calculate_new_color_value!(
120+
$crate::calculate_new_color_value!(
121121
relative_difference,
122122
self.colors,
123123
index_upper,
@@ -134,7 +134,7 @@ implement_color_scale_for_derived_color_map! {RGBAColor, RGBColor, HSLColor}
134134

135135
macro_rules! count {
136136
() => (0usize);
137-
($x:tt $($xs:tt)* ) => (1usize + count!($($xs)*));
137+
($x:tt $($xs:tt)* ) => (1usize + $crate::count!($($xs)*));
138138
}
139139

140140
macro_rules! define_colors_from_list_of_values_or_directly{
@@ -171,7 +171,7 @@ macro_rules! implement_linear_interpolation_color_map {
171171
Self::COLORS.len()
172172
);
173173
// Interpolate the final color linearly
174-
calculate_new_color_value!(
174+
$crate::calculate_new_color_value!(
175175
relative_difference,
176176
Self::COLORS,
177177
index_upper,
@@ -218,21 +218,21 @@ macro_rules! define_linear_interpolation_color_map{
218218

219219
impl $color_scale_name {
220220
// const COLORS: [$color_type; $number_colors] = [$($color_type($($color_value),+)),+];
221-
// const COLORS: [$color_type; count!($(($($color_value:expr),+))*)] = [$($color_type($($color_value),+)),+];
222-
const COLORS: [$color_type; count!($(($($color_value:expr),+))*)] = define_colors_from_list_of_values_or_directly!{$color_type, $(($($color_value),+)),*};
221+
// const COLORS: [$color_type; $crate::count!($(($($color_value:expr),+))*)] = [$($color_type($($color_value),+)),+];
222+
const COLORS: [$color_type; $crate::count!($(($($color_value:expr),+))*)] = $crate::define_colors_from_list_of_values_or_directly!{$color_type, $(($($color_value),+)),*};
223223
}
224224

225-
implement_linear_interpolation_color_map!{$color_scale_name, $color_type}
225+
$crate::implement_linear_interpolation_color_map!{$color_scale_name, $color_type}
226226
};
227227
($color_scale_name:ident, $color_type:ident, $doc:expr, $($color_complete:tt),+) => {
228228
#[doc = $doc]
229229
pub struct $color_scale_name {}
230230

231231
impl $color_scale_name {
232-
const COLORS: [$color_type; count!($($color_complete)*)] = define_colors_from_list_of_values_or_directly!{$($color_complete),+};
232+
const COLORS: [$color_type; $crate::count!($($color_complete)*)] = $crate::define_colors_from_list_of_values_or_directly!{$($color_complete),+};
233233
}
234234

235-
implement_linear_interpolation_color_map!{$color_scale_name, $color_type}
235+
$crate::implement_linear_interpolation_color_map!{$color_scale_name, $color_type}
236236
}
237237
}
238238

0 commit comments

Comments
 (0)