diff --git a/src/iter.rs b/src/iter.rs index 2c5828f0..91534885 100644 --- a/src/iter.rs +++ b/src/iter.rs @@ -12,6 +12,7 @@ use std::time::Duration; use tokio::io::{ReadBuf, SeekFrom}; use crate::progress_bar::ProgressBar; +use crate::state::ProgressFinish; use crate::style::ProgressStyle; /// Wraps an iterator to display its progress. @@ -103,6 +104,14 @@ impl ProgressBarIter { self.progress = self.progress.with_elapsed(elapsed); self } + + /// Builder-like function for setting underlying progress bar's finish behavior. + /// + /// See [ProgressBar::with_finish]. + pub fn with_finish(mut self, finish: ProgressFinish) -> Self { + self.progress = self.progress.with_finish(finish); + self + } } impl> Iterator for ProgressBarIter {