fix: fix README code examples

This commit is contained in:
ad4mx 2022-07-18 10:54:02 +02:00
parent 6edd5be510
commit 13abe7f557
2 changed files with 4 additions and 4 deletions

View file

@ -14,7 +14,7 @@
## Usage ## Usage
```rust ```rust
use spinoff::{Spinner, Spinners}; use spinoff::{Spinner, Spinners, Color};
use std::thread::sleep; use std::thread::sleep;
use std::time::Duration; use std::time::Duration;
@ -26,7 +26,7 @@ spinner.success("Done!");
### Update a spinner ### Update a spinner
```rust ```rust
use spinoff::{Spinner, Spinners}; use spinoff::{Spinner, Spinners, Color};
use std::thread::sleep; use std::thread::sleep;
use std::time::Duration; use std::time::Duration;

View file

@ -1,8 +1,8 @@
use spinoff::{Spinner, Spinners}; use spinoff::{Spinner, Spinners, Color};
use std::{thread::sleep, time::Duration}; use std::{thread::sleep, time::Duration};
fn main() { fn main() {
let sp = Spinner::new(Spinners::Dots, "Loading...", None); let sp = Spinner::new(Spinners::Dots, "Loading...", Some(Color::Blue));
sleep(Duration::from_secs(5)); sleep(Duration::from_secs(5));
sp.stop_and_persist("🍕", "Pizza!"); sp.stop_and_persist("🍕", "Pizza!");
} }