855fe50c974c74462bfa6714eac3989e91f9d274
commit 855fe50c974c74462bfa6714eac3989e91f9d274
Author: spesk1 <spesk1@pm.me>
Date: Fri May 17 18:22:14 2019 -0400

Chaning print

diff --git a/.gitignore b/.gitignore
index ea8c4bf..32af38c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/target
+/.sg
diff --git a/src/main.rs b/src/main.rs
index fc450cf..36bae8f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -51,16 +51,16 @@ fn main() {
.help("Path to find size of"))
.get_matches();

- let total = get_fill(String::from(matches.value_of("path").unwrap()));
+ let path_string = String::from(matches.value_of("path").unwrap());
+ let total = get_fill(path_string);
let bytes_total = total.unwrap();
let kb_total = bytes_total as f64 / 1024.0;
let mb_total = bytes_total as f64 / 1024.0 / 1024.0;
let gb_total = bytes_total as f64 / 1024.0 / 1024.0 / 1024.0;
let tb_total = bytes_total as f64 / 1024.0 / 1024.0 / 1024.0 / 1024.0;
- println!("Total of test dir in B is: {}",bytes_total);
- println!("Total of test dir in KB is: {}",kb_total);
- println!("Total of test dir in MB is: {}",mb_total);
- println!("Total of test dir in GB is: {}",gb_total);
- println!("Total of test dir in TB is: {}",tb_total);
+ // Recreate this cause we used if for get_fill already
+ let path_string = String::from(matches.value_of("path").unwrap());
+ print!("Total of {} is: | {} B | {} KB | {} MB | {} GB | {} TB |\n",
+ path_string,bytes_total,kb_total,mb_total,gb_total,tb_total);

}