diff options
author | Daniel <kingdread@gmx.de> | 2020-04-04 14:13:59 +0200 |
---|---|---|
committer | Daniel <kingdread@gmx.de> | 2020-04-04 14:13:59 +0200 |
commit | c748642f3b801aa5ff4044ab60b0d0c29037a802 (patch) | |
tree | abfd9f5d4cb6f4f4024673ca99716c8ab1d510a4 /src/output/aggregators.rs | |
parent | 5d2f51ab8593946a0f24db367a887a37258901d5 (diff) | |
download | raidgrep-c748642f3b801aa5ff4044ab60b0d0c29037a802.tar.gz raidgrep-c748642f3b801aa5ff4044ab60b0d0c29037a802.tar.bz2 raidgrep-c748642f3b801aa5ff4044ab60b0d0c29037a802.zip |
make pipeline working
Diffstat (limited to 'src/output/aggregators.rs')
-rw-r--r-- | src/output/aggregators.rs | 12 |
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) {} } |