From 1a7753b350e862b844d3c2fa27766e52f499efc7 Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 19 May 2022 14:10:45 +0300 Subject: code cleanup --- src/main.rs | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 781ee2b..6ff1439 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,34 +1,15 @@ use std::env; -use correlation_rust::parser; -use correlation_rust::correlations; +use correlation_rust::analysis::Analysis; fn main () { - - - let json_file = match env::args().nth(1){ + match env::args().nth(1){ Some(tmp_file) => { - let results = parser::JsonData::new(&tmp_file); - - - let parsed_x_vals:Vec = results.x_vals.split(",").map(|f|f.trim().parse::().unwrap()).collect(); - - - - let computation = correlations::Compute::new( - ',', - "pearson", - &results.file_path, - &parsed_x_vals - - ).compute(); - - //println!("{:?}",computation); - + + match Analysis::compute(&tmp_file){ + Ok(results) => println!("{:?}",results), + Err(err) => println!("{:?}",err) + } } None => panic!("expected an arugment for the json file") }; - - - - -} \ No newline at end of file +} -- cgit 1.4.1