diff --git a/src/style.rs b/src/style.rs index 05f56c43..a28d0807 100644 --- a/src/style.rs +++ b/src/style.rs @@ -709,7 +709,7 @@ enum Alignment { } /// Trait for defining stateful or stateless formatters -pub trait ProgressTracker: Send { +pub trait ProgressTracker: Send + Sync { /// Creates a new instance of the progress tracker fn clone_box(&self) -> Box; /// Notifies the progress tracker of a tick event @@ -726,7 +726,10 @@ impl Clone for Box { } } -impl ProgressTracker for F { +impl ProgressTracker for F +where + F: Fn(&ProgressState, &mut dyn fmt::Write) + Send + Sync + Clone + 'static, +{ fn clone_box(&self) -> Box { Box::new(self.clone()) }