diff options
author | Till Höppner | 2016-01-13 13:32:46 +0100 |
---|---|---|
committer | Till Höppner | 2016-01-20 20:20:32 +0100 |
commit | 8e2f17b9838d60214f007c8108ee7069c458f40d (patch) | |
tree | 7fff0100a7e24f2149fb395abd8af3d869326040 /src/main.rs | |
parent | 25b2ed76faf6d55455dec3b90096faa01816f52d (diff) | |
download | ilc-8e2f17b9838d60214f007c8108ee7069c458f40d.tar.gz ilc-8e2f17b9838d60214f007c8108ee7069c458f40d.tar.xz ilc-8e2f17b9838d60214f007c8108ee7069c458f40d.zip |
Updated dependencies, still doesn't build
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/main.rs b/src/main.rs index 9ed0646..285995c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,7 +42,7 @@ use chrono::naive::date::NaiveDate; use glob::glob; use ilc::context::Context; -use ilc::format::{ self, Encode, Decode, DecodeBox }; +use ilc::format::{ self, Encode, Decode }; use ilc::event::{ Event, Type, NoTimeHash }; use ageset::AgeSet; @@ -116,7 +116,7 @@ fn die(s: &str) -> ! { process::exit(1) } -fn force_decoder<'a>(s: Option<String>) -> Box<DecodeBox<'a, &'a mut BufRead>> { +fn force_decoder<'a, 'b, 'c>(s: Option<String>) -> Box<Decode<'a, 'b, 'c>> { let inf = match s { Some(s) => s, None => die("You didn't specify the input format") @@ -127,7 +127,7 @@ fn force_decoder<'a>(s: Option<String>) -> Box<DecodeBox<'a, &'a mut BufRead>> { } } -fn force_encoder<'a>(s: Option<String>) -> Box<Encode<'a, &'a mut Write>> { +fn force_encoder<'a, 'b: 'a>(s: Option<String>) -> Box<Encode<'a, &'b mut Write>> { let outf = match s { Some(s) => s, None => die("You didn't specify the output format") @@ -167,23 +167,25 @@ fn main() { Box::new(BufReader::new(io::stdin())) }; - let mut output: Box<Write> = if let Some(out) = args.flag_out { + /*let mut output: Box<Write> = if let Some(out) = args.flag_out { match File::create(out) { Ok(f) => Box::new(BufWriter::new(f)), Err(e) => error(Box::new(e)) } } else { Box::new(BufWriter::new(io::stdout())) - }; - - if args.cmd_parse { - let mut decoder = force_decoder(args.flag_inf); - let encoder = force_encoder(args.flag_outf); - for e in decoder.decode_box(&context, &mut input) { - info!("Parsed: {:?}", e); - let _ = encoder.encode(&context, &mut output, &e.unwrap()); - } - } else if args.cmd_convert { + };*/ + + //if args.cmd_parse { + let mut i = io::empty(); + let mut decoder: Box<Decode> = Box::new(format::Dummy);//force_decoder(args.flag_inf); + // let encoder = force_encoder(args.flag_outf); + let iter = decoder.decode(&context, &mut i); + //for e in decoder.decode_box(&context, &mut input) { + //let e = e.unwrap(); + //let _ = encoder.encode(&context, &mut output, &e); + //} + /*}*/ /*else if args.cmd_convert { let mut decoder = force_decoder(args.flag_inf); let encoder = force_encoder(args.flag_outf); for e in decoder.decode_box(&context, &mut input) { @@ -274,5 +276,5 @@ fn main() { } } } - } + }*/ } |