aboutsummaryrefslogtreecommitdiff
path: root/src/output/aggregators.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/output/aggregators.rs')
-rw-r--r--src/output/aggregators.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/output/aggregators.rs b/src/output/aggregators.rs
index 9934fb3..5d0429c 100644
--- a/src/output/aggregators.rs
+++ b/src/output/aggregators.rs
@@ -8,11 +8,11 @@
//! an Aggregator must make sure that the data is protected by a mutex or similar.
use super::{super::LogResult, formats::Format};
-use std::{io::Write, sync::Mutex};
+use std::io::Write;
pub trait Aggregator: Sync {
- fn push_item(&self, item: &LogResult, format: &Format, stream: &mut Write);
- fn finish(self, format: &Format, stream: &mut Write);
+ fn push_item(&self, item: &LogResult, format: &dyn Format, stream: &mut dyn Write);
+ fn finish(self, format: &dyn Format, stream: &mut dyn Write);
}
@@ -22,11 +22,11 @@ pub struct WriteThrough;
impl Aggregator for WriteThrough {
- fn push_item(&self, item: &LogResult, format: &Format, stream: &mut Write) {
+ fn push_item(&self, item: &LogResult, format: &dyn Format, stream: &mut dyn Write) {
let text = format.format_result(item);
- println!("Aggregator::push_item {:?}", text);
stream.write_all(text.as_bytes()).unwrap();
+ stream.flush().unwrap();
}
- fn finish(self, format: &Format, stream: &mut Write) {}
+ fn finish(self, _: &dyn Format, _: &mut dyn Write) {}
}