From c748642f3b801aa5ff4044ab60b0d0c29037a802 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 4 Apr 2020 14:13:59 +0200 Subject: make pipeline working --- src/output/aggregators.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/output/aggregators.rs') 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) {} } -- cgit v1.2.3