diff options
author | Valentin Popov <info@valentineus.link> | 2019-01-27 02:31:37 +0300 |
---|---|---|
committer | Valentin Popov <info@valentineus.link> | 2019-01-27 02:31:37 +0300 |
commit | 65ab398355ed0d68d6c7fb82edaef6afcd00b591 (patch) | |
tree | c824b70363bdc60dce782f9e59682247a34a6594 /src | |
parent | b591a9c5676f50d226357f4ced531c9f3c62fe08 (diff) | |
download | bbb2json-65ab398355ed0d68d6c7fb82edaef6afcd00b591.tar.xz bbb2json-65ab398355ed0d68d6c7fb82edaef6afcd00b591.zip |
Sun, 27 Jan 2019 03:31:37 +0400
Signed-off-by: Valentin Popov <info@valentineus.link>
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 401bbe4..5b35f4a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ use std::fs::File; use std::io::BufReader; +use std::path::Path; extern crate clap; use clap::{load_yaml, App}; @@ -13,7 +14,11 @@ fn main() { let path = matches.value_of("FILE").unwrap(); - let file: File = File::open(path).unwrap(); - let data: ParserResult = parse(BufReader::new(file)); - dbg!(data.meeting_name); + match Path::new(path).exists() { + true => { + let file: File = File::open(path).unwrap(); + let data: ParserResult = parse(BufReader::new(file)); + } + _ => panic!("Error File!"), + }; } |