File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ pub struct Record {
23
23
pub freq_low : u64 ,
24
24
pub freq_high : u64 ,
25
25
pub freq_step : f32 ,
26
+ #[ allow( dead_code) ]
26
27
pub num_samples : u32 ,
27
28
pub samples : Vec < f32 > ,
28
29
}
@@ -56,7 +57,7 @@ pub fn load_records(input_path: &str) -> Result<RecordCollection, Box<dyn Error>
56
57
. trim ( csv:: Trim :: All )
57
58
. from_reader ( input) ;
58
59
59
- let mut rc = RecordCollection { freq_low : std :: u64:: MAX , ..Default :: default ( ) } ;
60
+ let mut rc = RecordCollection { freq_low : u64:: MAX , ..Default :: default ( ) } ;
60
61
61
62
// Loop through all lines & parse records
62
63
// also keep track of frequency range & unique timestamps to determine final image size
@@ -72,7 +73,7 @@ pub fn load_records(input_path: &str) -> Result<RecordCollection, Box<dyn Error>
72
73
rc. freq_low = std:: cmp:: min ( rc. freq_low , record. freq_low ) ;
73
74
rc. freq_high = std:: cmp:: max ( rc. freq_high , record. freq_high ) ;
74
75
if let Some ( s) = step {
75
- if ( s - record. freq_step ) . abs ( ) > std :: f32:: EPSILON {
76
+ if ( s - record. freq_step ) . abs ( ) > f32:: EPSILON {
76
77
return Err ( "Frequency step must be constant" . into ( ) ) ;
77
78
}
78
79
} else {
Original file line number Diff line number Diff line change @@ -26,9 +26,9 @@ pub fn colormaps() -> HashMap<&'static str, Gradient> {
26
26
}
27
27
28
28
fn build_lut ( colormap : & Gradient ) -> Vec < plotters:: style:: RGBColor > {
29
- let mut lut = Vec :: with_capacity ( std :: u16:: MAX as usize + 1 ) ;
30
- for i in 0 ..std :: u16:: MAX as usize + 1 {
31
- let value = colormap. eval_continuous ( i as f64 / std :: u16:: MAX as f64 ) ;
29
+ let mut lut = Vec :: with_capacity ( u16:: MAX as usize + 1 ) ;
30
+ for i in 0 ..u16:: MAX as usize + 1 {
31
+ let value = colormap. eval_continuous ( i as f64 / u16:: MAX as f64 ) ;
32
32
lut. push ( plotters:: style:: RGBColor ( value. r , value. g , value. b ) ) ;
33
33
}
34
34
lut
You can’t perform that action at this time.
0 commit comments