about summary refs log tree commit diff
path: root/src/correlations.rs
diff options
context:
space:
mode:
authorAlexander_Kabui <alexanderkabua@gmail.com>2022-08-08 14:09:18 +0300
committerAlexander_Kabui <alexanderkabua@gmail.com>2022-08-08 14:09:18 +0300
commit3efeead9ca1c5705ff5b50ced14401c4ea99f506 (patch)
tree069f1c018393ce80c8c3512ee7ec5b168a31ab7b /src/correlations.rs
parentdb0b9c7fc340e09babe7be0609539359c9a05390 (diff)
downloadcorrelation_rust-3efeead9ca1c5705ff5b50ced14401c4ea99f506.tar.gz
rust clippy fixes
Diffstat (limited to 'src/correlations.rs')
-rw-r--r--src/correlations.rs21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/correlations.rs b/src/correlations.rs
index d7eda00..62f536e 100644
--- a/src/correlations.rs
+++ b/src/correlations.rs
@@ -109,10 +109,10 @@ impl<'a> Compute<'a> {
         };
 
         Self {
-            x_vals: x_vals,
-            dataset_path: dataset_path,
-            method: method,
-            output_file: output_file,
+            x_vals,
+            dataset_path,
+            method,
+            output_file,
             file_delimiter: file_delimeter,
         }
     }
@@ -135,7 +135,6 @@ impl<'a> Compute<'a> {
     }
 
     pub fn compute(&self) -> std::io::Result<String> {
-
         let mut corr_results: Vec<(String, f64, f64, i32)> = Vec::new();
 
         let reader = BufferReader::new(self.dataset_path);
@@ -161,8 +160,6 @@ impl<'a> Compute<'a> {
 
                 while let Some(val) = buffer_read.read_line(&mut n_string) {
                     if let Ok(array_new_val) = val {
-            
-
                         let ty = parse_rows_with_names(
                             self.x_vals,
                             &array_new_val
@@ -195,10 +192,7 @@ impl<'a> Compute<'a> {
 
         corr_results.sort_by(|a, b| b.1.abs().partial_cmp(&a.1.abs()).unwrap());
 
-        // corr_results.sort_by(|a,b|b.1.abs().partial_cmp(&a.1.abs()).unwrap());
-        return sort_write_to_file(String::from(self.output_file), corr_results);
-
-    
+        sort_write_to_file(String::from(self.output_file), corr_results)
     }
 }
 #[derive(PartialEq, Debug)]
@@ -323,10 +317,6 @@ mod tests {
         let corr_results = compute_obj.compute();
 
         assert!(corr_results.is_ok())
-
-
-
-   
     }
 
     #[test]
@@ -358,7 +348,6 @@ mod tests {
         )
     }
 
-
     #[test]
     fn test_sorter() {
         let mut a = vec![(1.2, 1.0), (1.3, 0.5), (1.3, 7.)];