Skip to content

Commit bbd6331

Browse files
committed
utils: Allow non-static str for spinner
I have a use case for dynamic strings, this just requires duplicating the string for the progress bar. Signed-off-by: Colin Walters <[email protected]>
1 parent 0c6ccad commit bbd6331

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ pub(crate) fn medium_visibility_warning(s: &str) {
132132
/// with an automatic spinner to show that we're not blocked.
133133
/// Note that generally the called function should not output
134134
/// anything to stdout as this will interfere with the spinner.
135-
pub(crate) async fn async_task_with_spinner<F, T>(msg: &'static str, f: F) -> T
135+
pub(crate) async fn async_task_with_spinner<F, T>(msg: &str, f: F) -> T
136136
where
137137
F: Future<Output = T>,
138138
{
139139
let pb = indicatif::ProgressBar::new_spinner();
140140
let style = indicatif::ProgressStyle::default_bar();
141141
pb.set_style(style.template("{spinner} {msg}").unwrap());
142-
pb.set_message(msg);
142+
pb.set_message(msg.to_string());
143143
pb.enable_steady_tick(Duration::from_millis(150));
144144
// We need to handle the case where we aren't connected to
145145
// a tty, so indicatif would show nothing by default.

0 commit comments

Comments
 (0)