Skip to content

Commit 608f153

Browse files
authored
Update utils.rs
1 parent e3dfae2 commit 608f153

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

hacker/atomic/src/utils.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ pub fn run_command_with_progress(program: &str, args: Vec<&str>, message: &str)
1313
while progress_clone.load(Ordering::Relaxed) < 100 {
1414
let p = progress_clone.load(Ordering::Relaxed);
1515
let filled = (p as f32 / 100.0 * bar_length as f32) as usize;
16-
let bar: String = (0..bar_length).map(|i| if i < filled { '#' } else { '.' }).collect();
17-
print!("\r{}% <{}>", p, bar.purple().bold());
16+
let bar: String = (0..bar_length).map(|i| if i < filled { '.' } else { ' ' }).collect();
17+
print!("\r{}% <{} >", p, bar.purple().bold());
1818
let _ = io::stdout().flush();
1919
thread::sleep(Duration::from_millis(200)); // Simulate progress
2020
progress_clone.store((p + 2).min(99), Ordering::Relaxed); // Increment slowly
2121
}
22-
print!("\r100% <{}> \n", "#".repeat(bar_length).purple().bold());
22+
print!("\r100% <{} > \n", ".".repeat(bar_length).purple().bold());
2323
let _ = io::stdout().flush();
2424
});
25-
let mut child = Command::new(program)
26-
.args(&args)
27-
.stdout(Stdio::piped())
28-
.stderr(Stdio::piped())
29-
.spawn()
30-
.expect(&format!("Failed to execute {}", program));
25+
let child = Command::new(program)
26+
.args(&args)
27+
.stdout(Stdio::piped())
28+
.stderr(Stdio::piped())
29+
.spawn()
30+
.expect(&format!("Failed to execute {}", program));
3131
// Simple simulation, no real progress parsing for now
3232
let output = child.wait_with_output().expect("Failed to wait on child");
3333
progress.store(100, Ordering::Relaxed);

0 commit comments

Comments
 (0)