fix: fix README code examples
This commit is contained in:
parent
6edd5be510
commit
13abe7f557
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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!");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue