aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2019-01-27 02:31:37 +0300
committerValentin Popov <info@valentineus.link>2019-01-27 02:31:37 +0300
commit65ab398355ed0d68d6c7fb82edaef6afcd00b591 (patch)
treec824b70363bdc60dce782f9e59682247a34a6594 /src/main.rs
parentb591a9c5676f50d226357f4ced531c9f3c62fe08 (diff)
downloadbbb2json-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/main.rs')
-rw-r--r--src/main.rs11
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!"),
+ };
}