diff options
author | Canop <cano.petrole@gmail.com> | 2019-10-23 17:25:47 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2019-10-23 17:25:47 +0200 |
commit | 34d760afb02e986b4c109127ba3027f0783a0e00 (patch) | |
tree | be53f28aed6c7e87ea9a84b2634856d15eaa94d6 /src/file_sizes/file_sizes_default.rs | |
parent | 1b5060a3fa7eccfa9fb5d675bcaff1d45a577581 (diff) |
move to the last versions of crossterm and termimad
Diffstat (limited to 'src/file_sizes/file_sizes_default.rs')
-rw-r--r-- | src/file_sizes/file_sizes_default.rs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/file_sizes/file_sizes_default.rs b/src/file_sizes/file_sizes_default.rs index bed8584..be30229 100644 --- a/src/file_sizes/file_sizes_default.rs +++ b/src/file_sizes/file_sizes_default.rs @@ -1,14 +1,17 @@ //! size computation for non linux +use std::{ + fs, + path::{Path, PathBuf}, + sync::atomic::{AtomicIsize, AtomicUsize, Ordering}, + sync::Arc, + thread, + time::Duration, +}; + +use crossbeam::{channel::unbounded, sync::WaitGroup}; + use crate::task_sync::TaskLifetime; -use crossbeam::channel::unbounded; -use crossbeam::sync::WaitGroup; -use std::fs; -use std::path::{Path, PathBuf}; -use std::sync::atomic::{AtomicIsize, AtomicUsize, Ordering}; -use std::sync::Arc; -use std::thread; -use std::time::Duration; pub fn compute_dir_size(path: &Path, tl: &TaskLifetime) -> Option<u64> { let size = Arc::new(AtomicUsize::new(0)); @@ -67,7 +70,6 @@ pub fn compute_dir_size(path: &Path, tl: &TaskLifetime) -> Option<u64> { Some(size) } - pub fn compute_file_size(path: &Path) -> u64 { match fs::metadata(path) { Ok(m) => m.len(), |