// visit_fn is intentionally a function pointer to prevent painfully long recompilation
// whenever visit_fn is changed; cargo workspaces might help, if I knew how to use them :/
visit_fn is intentionally a function pointer to prevent painfully long recompilation
whenever visit_fn is changed; cargo workspaces might help, if I knew how to use them .
visit_fn is intentionally a function pointer to prevent painfully long recompilation whenever visit_fn is changed ; cargo workspaces might help if I knew how to use them .
pub fn process(&self, count_files: Vec<String>, visit_fn: fn(&Candlestick, &ByteRecord) -> ()) {
        for count_file in count_files {
            let mut reader = csv::Reader::from_path(count_file.clone())
                .expect(&format!("Opening {}", count_file));
            for record in reader.byte_records() {
                if record.is_err() {
                    warn!("file {} record {:?}", count_file, record);
                    continue;
                }
                let trace = record.unwrap();
                let tmp = trace.get(0).unwrap();
                let ts: u64 = unsafe { str::from_utf8_unchecked(tmp).parse().unwrap() };
                let candle = self.prices.nearest_record(ts).unwrap();
                visit_fn(candle, &trace);
            }
        }
    }
pub fn process ( & self , count_files : Vec < String > , visit_fn : fn ( & Candlestick , & ByteRecord ) -> ( ) ) { for count_file in count_files { let mut reader = csv :: Reader :: from_path ( count_file . clone ( ) ) . expect ( & format ! ( " " count_file ) ) ; for record in reader . byte_records ( ) { if record . is_err ( ) { warn ! ( " " count_file record ) ; continue ; } let trace = record . unwrap ( ) ; let tmp = trace . get ( 0 ) . unwrap ( ) ; let ts : u64 = unsafe { str :: from_utf8_unchecked ( tmp ) . parse ( ) . unwrap ( ) } ; let candle = self . prices . nearest_record ( ts ) . unwrap ( ) ; visit_fn ( candle , & trace ) ; } } }
visit_fn is intentionally a function pointer to prevent painfully long recompilation
whenever visit_fn is changed; cargo workspaces might help, if I knew how to use them :
visit_fn is intentionally a function pointer to prevent painfully long recompilation whenever visit_fn is changed ; cargo workspaces might help if I knew how to use them :
&self
count_files
Vec<String>
visit_fn
fn(&Candlestick, &ByteRecord) -> ()