diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 1bdf090..b5f65a9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,11 +8,11 @@ extern crate libc; extern crate regex; use std::fs::File; -use std::io::BufReader; +use std::io::{ self, BufReader }; use docopt::Docopt; -use ilc::format::{ self, Decode }; +use ilc::format::{ self, Encode, Decode }; static USAGE: &'static str = " A converter and statistics utility for IRC log files. @@ -47,8 +47,10 @@ fn main() { for file in args.arg_file { let f: BufReader<File> = BufReader::new(File::open(file).unwrap()); let iter = parser.decode(f); - println!("Obtained event iterator"); - for e in iter { println!("{:?}", e) } + let events: Vec<_> = iter.collect(); + for e in events { + parser.encode(io::stdout(), &e.unwrap()); + } } } } |