Commit 863869ba authored by Stefan Schindler's avatar Stefan Schindler
Browse files

Add time it took

parent 45a0f2db
...@@ -141,7 +141,7 @@ enum DiskState { ...@@ -141,7 +141,7 @@ enum DiskState {
Protected, Protected,
QueueForWhipe, QueueForWhipe,
Wiping{ progress: ByteUnit, per_second: ByteUnit }, Wiping{ progress: ByteUnit, per_second: ByteUnit },
Wiped, Wiped{ took: Duration },
WipeFailed, WipeFailed,
} }
use DiskState::*; use DiskState::*;
...@@ -153,7 +153,7 @@ impl Display for DiskState { ...@@ -153,7 +153,7 @@ impl Display for DiskState {
&Protected => write!(f, "Protected"), &Protected => write!(f, "Protected"),
&QueueForWhipe => write!(f, "Queued for Whipe"), &QueueForWhipe => write!(f, "Queued for Whipe"),
&Wiping { ref progress, ref per_second } => write!(f, "Whiping {} ({}/s)", progress, per_second), &Wiping { ref progress, ref per_second } => write!(f, "Whiping {} ({}/s)", progress, per_second),
&Wiped => write!(f, "Wiped successfully"), &Wiped { ref took } => write!(f, "Wiped successfully in {} seconds", took.as_secs()),
&WipeFailed=> write!(f, "Wipe failed"), &WipeFailed=> write!(f, "Wipe failed"),
} }
} }
...@@ -355,11 +355,11 @@ fn update_jobs(disks: &Vec<Arc<DiskInformation>>, pool: &threadpool::ThreadPool) ...@@ -355,11 +355,11 @@ fn update_jobs(disks: &Vec<Arc<DiskInformation>>, pool: &threadpool::ThreadPool)
match whipe_disk(&disk) { match whipe_disk(&disk) {
Ok(duration) => { Ok(duration) => {
*disk.state.lock().unwrap() = Wiped; *disk.state.lock().unwrap() = Wiped{ took: duration };
println!("{}{} in {}", println!("{}{} in {} seconds",
Green.dimmed().paint("Wiped "), Green.dimmed().paint("Wiped "),
BOLD.paint(&*disk.name), BOLD.paint(&*disk.name),
duration duration.as_secs()
); );
}, },
Err(e) => { Err(e) => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment