Moved all encoding and decoding functions onto Codec methods that contain configuration set with a builder pattern on Config structs.

Part of issue #24.
This commit is contained in:
Alex Helfet 2017-12-31 15:29:59 +00:00
commit dd17f1f65d

View file

@ -14,7 +14,6 @@ mod error;
use error::{Error, Result};
use clap::Arg;
use framed::typed::Receiver;
use std::io::{stdin, stdout};
arg_enum! {
@ -47,7 +46,9 @@ fn try() -> Result<()> {
let matches = app.get_matches();
let out_fmt = value_t!(matches, "out-format", OutputFormat)?;
let mut r = Receiver::<_, UserType>::new(stdin());
let mut r = framed::bytes::Config::default()
.typed::<UserType>()
.into_receiver(stdin());
let mut csvw: Option<csv::Writer<_>> =
match out_fmt {