Skip to content

Commit

Permalink
Run cargo fmt (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
LingMan authored Jul 2, 2022
1 parent a5c1e83 commit 09a8e59
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
7 changes: 5 additions & 2 deletions examples/multi_bg.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use pbr::MultiBar;
use std::{
sync::{atomic::{AtomicBool, Ordering}, Arc},
sync::{
atomic::{AtomicBool, Ordering},
Arc,
},
thread,
time::Duration,
};
Expand All @@ -23,7 +26,7 @@ fn main() {
for _ in 0..100 {
thread::sleep(Duration::from_millis(50));
bar.inc();
}
}

bar.finish_print(&format!("Task {} Complete", task));
}
Expand Down
5 changes: 2 additions & 3 deletions src/pb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,8 @@ impl<T: Write> ProgressBar<T> {
let rema_count = size - curr_count;
base = self.bar_start.clone();
if rema_count > 0 && curr_count > 0 {
base = base
+ &self.bar_current.repeat(curr_count - 1)
+ &self.bar_current_n;
base =
base + &self.bar_current.repeat(curr_count - 1) + &self.bar_current_n;
} else {
base = base + &self.bar_current.repeat(curr_count);
}
Expand Down
4 changes: 2 additions & 2 deletions src/tty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ mod unix;
#[cfg(unix)]
pub use self::unix::*;

#[cfg(target_os="wasi")]
#[cfg(target_os = "wasi")]
mod wasi;
#[cfg(target_os="wasi")]
#[cfg(target_os = "wasi")]
pub use self::wasi::*;

#[cfg(windows)]
Expand Down
4 changes: 2 additions & 2 deletions src/tty/wasi.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{Width, Height};
use super::{Height, Width};

/// For WASI so far it will return none
///
Expand All @@ -8,7 +8,7 @@ pub fn terminal_size() -> Option<(Width, Height)> {
}

/// This is inherited from unix and will work only when wasi executed on unix.
///
///
/// For background https://github.com/WebAssembly/WASI/issues/42
pub fn move_cursor_up(n: usize) -> String {
format!("\x1B[{}A", n)
Expand Down

0 comments on commit 09a8e59

Please sign in to comment.