diff options
author | Valentin Popov <info@valentineus.link> | 2019-01-27 03:08:26 +0300 |
---|---|---|
committer | Valentin Popov <info@valentineus.link> | 2019-01-27 03:08:26 +0300 |
commit | 13bb4bff227d46b2ae6dbfa389846af66e7dfcd1 (patch) | |
tree | fac96e69581f8d897d636e36b06ac85a162702db /src | |
parent | afe4062e43fd647a588f94792dfd2b9630fcb2b2 (diff) | |
download | bbb2json-13bb4bff227d46b2ae6dbfa389846af66e7dfcd1.tar.xz bbb2json-13bb4bff227d46b2ae6dbfa389846af66e7dfcd1.zip |
Sun, 27 Jan 2019 04:08:26 +0400
Signed-off-by: Valentin Popov <info@valentineus.link>
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 6774ec7..a8f8e85 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,8 +5,9 @@ use std::path::Path; extern crate clap; use clap::{load_yaml, App}; -extern crate rustc_serialize; -use rustc_serialize::json; +#[macro_use] +extern crate serde_derive; +extern crate serde_json; mod parser; use parser::*; @@ -20,8 +21,8 @@ fn main() { match Path::new(path).exists() { true => { let file: File = File::open(path).unwrap(); - let data: ParserResult = parse(BufReader::new(file)); - println!("{}", json::as_pretty_json(&data)); + let data: ParserResult = parser(BufReader::new(file)); + println!("{:#?}", serde_json::to_string_pretty(&data)); } _ => panic!("Error File!"), }; |