Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 1d404c3

Browse files
committed
Make explicit that notifiers take ownership of Output
1 parent d04cf67 commit 1d404c3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/actions/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,12 @@ impl InitActionContext {
212212
show_warnings: config.show_warnings,
213213
use_black_list: config.use_crate_blacklist,
214214
active_build_count: self.active_build_count.clone(),
215-
notifier: Box::new(BuildDiagnosticsNotifier::new(&out)),
215+
notifier: Box::new(BuildDiagnosticsNotifier::new(out.clone())),
216216
blocked_threads: vec![],
217217
}
218218
};
219219

220-
let notifier = Box::new(BuildProgressNotifier::new(&out));
220+
let notifier = Box::new(BuildProgressNotifier::new(out.clone()));
221221

222222
self.active_build_count.fetch_add(1, Ordering::SeqCst);
223223
self.build_queue

src/actions/progress.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ pub struct BuildProgressNotifier<O: Output> {
6666
}
6767

6868
impl<O: Output> BuildProgressNotifier<O> {
69-
pub fn new(out: &O) -> BuildProgressNotifier<O> {
69+
pub fn new(out: O) -> BuildProgressNotifier<O> {
7070
BuildProgressNotifier {
71-
out: out.clone(),
71+
out,
7272
progress_params: new_progress_params("Build".into()),
7373
}
7474
}
@@ -104,9 +104,9 @@ pub struct BuildDiagnosticsNotifier<O: Output> {
104104
}
105105

106106
impl<O: Output> BuildDiagnosticsNotifier<O> {
107-
pub fn new(out: &O) -> BuildDiagnosticsNotifier<O> {
107+
pub fn new(out: O) -> BuildDiagnosticsNotifier<O> {
108108
BuildDiagnosticsNotifier {
109-
out: out.clone(),
109+
out,
110110
progress_params: new_progress_params("Diagnostics".into()),
111111
}
112112
}

0 commit comments

Comments
 (0)