Sun, 27 Jan 2019 04:08:26 +0400
Signed-off-by: Valentin Popov <info@valentineus.link>
This commit is contained in:
parent
afe4062e43
commit
13bb4bff22
@ -5,8 +5,9 @@ use std::path::Path;
|
|||||||
extern crate clap;
|
extern crate clap;
|
||||||
use clap::{load_yaml, App};
|
use clap::{load_yaml, App};
|
||||||
|
|
||||||
extern crate rustc_serialize;
|
#[macro_use]
|
||||||
use rustc_serialize::json;
|
extern crate serde_derive;
|
||||||
|
extern crate serde_json;
|
||||||
|
|
||||||
mod parser;
|
mod parser;
|
||||||
use parser::*;
|
use parser::*;
|
||||||
@ -20,8 +21,8 @@ fn main() {
|
|||||||
match Path::new(path).exists() {
|
match Path::new(path).exists() {
|
||||||
true => {
|
true => {
|
||||||
let file: File = File::open(path).unwrap();
|
let file: File = File::open(path).unwrap();
|
||||||
let data: ParserResult = parse(BufReader::new(file));
|
let data: ParserResult = parser(BufReader::new(file));
|
||||||
println!("{}", json::as_pretty_json(&data));
|
println!("{:#?}", serde_json::to_string_pretty(&data));
|
||||||
}
|
}
|
||||||
_ => panic!("Error File!"),
|
_ => panic!("Error File!"),
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user