Skip to content

Commit

Permalink
Merge pull request #24 from jewlexx/master
Browse files Browse the repository at this point in the history
Implemented drop as a synonym for stop
  • Loading branch information
FGRibreau authored Mar 11, 2022
2 parents 2a99498 + 85f3c01 commit a2b0ded
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ include = ["src/**/*", "README.md"]
[dependencies]
lazy_static = { version = "1.4.0" }
maplit = { version = "1.0.2" }
strum = { version = "0.23.0", features = ["derive"] }
strum = { version = "0.24.0", features = ["derive"] }
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ pub struct Spinner {
sender: Sender<()>,
}

impl Drop for Spinner {
fn drop(&mut self) {
self.sender.send(()).unwrap();
}
}

impl Spinner {
/// Create a new spinner along with a message
///
Expand Down
2 changes: 1 addition & 1 deletion src/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pub mod spinner_data;
pub mod spinner_names;
pub mod spinners_data;
pub mod spinner_data;
1 change: 0 additions & 1 deletion src/utils/spinner_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ pub struct SpinnerData {
pub frames: Vec<&'static str>,
pub interval: u16,
}

0 comments on commit a2b0ded

Please sign in to comment.