Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify confusing bits about messages #102

Merged
merged 1 commit into from Sep 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/progress.rs
Expand Up @@ -445,6 +445,8 @@ impl ProgressBar {
/// let pb = ProgressBar::new(n);
/// pb.set_draw_delta(n / 100); // redraw every 1% of additional progress
/// ```
///
/// Note that `ProgressDrawTarget` may impose additional buffering of redraws.
pub fn set_draw_delta(&self, n: u64) {
let mut state = self.state.write();
state.draw_delta = n;
Expand Down Expand Up @@ -535,6 +537,9 @@ impl ProgressBar {
}

/// Sets the current message of the progress bar.
///
/// For the message to be visible, `{msg}` placeholder
/// must be present in the template (see `ProgressStyle`).
pub fn set_message(&self, msg: &str) {
let msg = msg.to_string();
self.update_and_draw(|state| {
Expand Down