Skip to content

Commit

Permalink
improve API symmetry
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Mar 2, 2020
1 parent dfc810b commit 759f1f4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "prodash"
version = "1.1.5"
version = "1.1.6"
authors = ["Sebastian Thiel <[email protected]>"]
description = "A dashboard for visualizing progress of asynchronous and possibly blocking tasks"
edition = "2018"
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ Run it with `cargo run --example dashboard` and see what else it can do by check
# Changelog
## v1.1.6
* improve API symmetry by providing a `Tree::name()` to accompany `Tree::set_name(…)`
## v1.1.5
* Flush stdout when the TUI stopped running. That way, the alternate/original screen will be shown right away.
Expand Down
5 changes: 5 additions & 0 deletions src/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ impl Item {
});
}

/// Get the name of this task's progress
pub fn name(&self) -> Option<String> {
self.tree.get(&self.key).map(|r| r.value().name.to_owned())
}

/// Set the current progress to the given `step`.
///
/// **Note**: that this call has no effect unless `init(…)` was called before.
Expand Down

0 comments on commit 759f1f4

Please sign in to comment.