Bar can spin now

This commit is contained in:
Yash Karandikar 2022-04-18 11:08:58 -05:00
parent a6ca126a8f
commit 7e2cb8cbd0
2 changed files with 26 additions and 2 deletions

7
Cargo.lock generated Normal file
View file

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "dimgup-cli"
version = "0.1.0"

View file

@ -1,3 +1,20 @@
fn main() {
println!("Hello, world!");
use std::io::Write;
macro_rules! loop_try {
($e:expr) => {
match $e {
Ok(v) => v,
Err(_) => continue,
}
};
}
fn main() {
let mut i = 0;
let chars = ['\\', '|', '/', '-'];
loop {
i += 1;
print!("{} \r", chars[i % chars.len()]);
loop_try!(std::io::stdout().flush());
}
}