aboutsummaryrefslogtreecommitdiff
path: root/src/output/mod.rs
diff options
context:
space:
mode:
authorDaniel <kingdread@gmx.de>2020-04-04 14:13:59 +0200
committerDaniel <kingdread@gmx.de>2020-04-04 14:13:59 +0200
commitc748642f3b801aa5ff4044ab60b0d0c29037a802 (patch)
treeabfd9f5d4cb6f4f4024673ca99716c8ab1d510a4 /src/output/mod.rs
parent5d2f51ab8593946a0f24db367a887a37258901d5 (diff)
downloadraidgrep-c748642f3b801aa5ff4044ab60b0d0c29037a802.tar.gz
raidgrep-c748642f3b801aa5ff4044ab60b0d0c29037a802.tar.bz2
raidgrep-c748642f3b801aa5ff4044ab60b0d0c29037a802.zip
make pipeline working
Diffstat (limited to 'src/output/mod.rs')
-rw-r--r--src/output/mod.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/output/mod.rs b/src/output/mod.rs
index dfb3ea8..73af5ab 100644
--- a/src/output/mod.rs
+++ b/src/output/mod.rs
@@ -1,4 +1,3 @@
-use super::errors::RuntimeError;
use super::{FightOutcome, LogResult, Opt};
use std::io;
@@ -7,20 +6,17 @@ pub mod formats;
pub mod aggregators;
pub mod pipeline;
-use self::formats::Format;
-use self::aggregators::Aggregator;
pub use self::pipeline::Pipeline;
/// Build an pipeline for the given command line options.
pub fn build_pipeline(opt: &Opt) -> Pipeline {
let stream = io::stdout();
+ let aggregator = aggregators::WriteThrough;
- let formatter: Box<dyn Format> = if opt.file_name_only {
- Box::new(formats::FileOnly)
+ if opt.file_name_only {
+ Pipeline::new(stream, formats::FileOnly, aggregator)
} else {
- Box::new(formats::HumanReadable)
- };
-
- Pipeline::new(stream, formatter, aggregators::WriteThrough)
+ Pipeline::new(stream, formats::HumanReadable, aggregator)
+ }
}