| skipped 1 lines |
2 | 2 | | use anyhow::Result; |
3 | 3 | | use dashmap::DashMap; |
4 | 4 | | use fxhash::hash64 as hasher; |
5 | | - | use indicatif::{ParallelProgressIterator, ProgressStyle}; |
| 5 | + | use indicatif::{ParallelProgressIterator, ProgressBar, ProgressIterator, ProgressStyle}; |
6 | 6 | | use memmap2::Mmap; |
7 | 7 | | use rayon::prelude::*; |
8 | 8 | | use std::hash::Hasher; |
| 9 | + | use std::time::Duration; |
9 | 10 | | use std::{fs, path::PathBuf}; |
10 | 11 | | |
11 | 12 | | #[derive(Clone, Copy)] |
| skipped 28 lines |
40 | 41 | | |
41 | 42 | | fn scan(app_opts: &Params) -> Result<Vec<File>> { |
42 | 43 | | let walker = app_opts.get_glob_walker()?; |
| 44 | + | let progress = ProgressBar::new_spinner(); |
| 45 | + | let progress_style = |
| 46 | + | ProgressStyle::with_template("{spinner:.green} [mapping paths] {pos} paths")?; |
| 47 | + | progress.set_style(progress_style); |
| 48 | + | progress.enable_steady_tick(Duration::from_millis(100)); |
| 49 | + | |
43 | 50 | | let files = walker |
| 51 | + | .progress_with(progress) |
44 | 52 | | .filter_map(Result::ok) |
45 | 53 | | .map(|file| file.into_path()) |
46 | 54 | | .filter(|fpath| fpath.is_file()) |
47 | 55 | | .collect::<Vec<PathBuf>>() |
48 | 56 | | .into_par_iter() |
49 | 57 | | .progress_with_style(ProgressStyle::with_template( |
50 | | - | "{spinner:.green} [processing scan results] [{wide_bar:.cyan/blue}] {pos}/{len} files", |
| 58 | + | "{spinner:.green} [processing mapped paths] [{wide_bar:.cyan/blue}] {pos}/{len} files", |
51 | 59 | | )?) |
52 | 60 | | .map(|fpath| fpath.display().to_string()) |
53 | 61 | | .map(|fpath| File { |
| skipped 73 lines |