Helper function to execute everything before running "inner_function"
(&mut self, inner_function: F)
| 21 | impl<T: Write + Send> ProgressHandler<T> { |
| 22 | /// Helper function to execute everything before running "inner_function" |
| 23 | fn handle<F: FnOnce(&mut Self) -> R, R>(&mut self, inner_function: F) -> R { |
| 24 | let handle = get_progress_bar(); |
| 25 | |
| 26 | match handle { |
| 27 | Some(pb) => pb.suspend(|| inner_function(self)), |
| 28 | None => inner_function(self), |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | /// Create a new instance of "Self" |
| 33 | pub fn new(pipe: T) -> Self { |
no test coverage detected