Skip to content

Commit be54063

Browse files
committed
Improved performance and cleaning code
1 parent 75bde18 commit be54063

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/utils.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ use std::{
1515
atomic::{AtomicUsize, Ordering},
1616
Arc, Mutex,
1717
},
18-
thread::sleep,
19-
time::Duration,
2018
};
2119
use walkdir::WalkDir;
2220

@@ -125,6 +123,13 @@ pub fn copy_incremental(
125123
}
126124
};
127125

126+
execute!(
127+
stdout(),
128+
MoveTo(0, progress_row - 2),
129+
Clear(ClearType::CurrentLine),
130+
ResetColor
131+
)?;
132+
128133
execute!(
129134
stdout(),
130135
MoveTo(0, progress_row - 3),
@@ -144,8 +149,6 @@ pub fn copy_incremental(
144149
total_files as f32,
145150
msg,
146151
);
147-
148-
sleep(Duration::from_millis(40));
149152
}
150153

151154
Ok((

0 commit comments

Comments
 (0)