forked from C4TG1RL5_UN1T3D/dimgup-cli
Bar can spin now
This commit is contained in:
parent
a6ca126a8f
commit
7e2cb8cbd0
7
Cargo.lock
generated
Normal file
7
Cargo.lock
generated
Normal 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"
|
21
src/main.rs
21
src/main.rs
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue