diff options
-rw-r--r-- | src/main.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index ca9b1c5..066a07a 100644 --- a/src/main.rs +++ b/src/main.rs | |||
@@ -16,10 +16,12 @@ fn main() { | |||
16 | let base_path = Path::new(&raw_files); | 16 | let base_path = Path::new(&raw_files); |
17 | 17 | ||
18 | for entry in WalkDir::new(base_path).min_depth(1).into_iter().filter_map(|e| e.ok()) { | 18 | for entry in WalkDir::new(base_path).min_depth(1).into_iter().filter_map(|e| e.ok()) { |
19 | println!("{:?}", entry.path()); | ||
20 | let mut f = File::open(entry.path()).expect("could not open file"); | 19 | let mut f = File::open(entry.path()).expect("could not open file"); |
21 | let mut buf = String::new(); | 20 | let mut buf = String::new(); |
22 | f.read_to_string(&mut buf).unwrap(); | 21 | if let Err(e) = f.read_to_string(&mut buf) { |
22 | println!("invalid file: {}", entry.path().to_str().unwrap()); | ||
23 | continue; | ||
24 | } | ||
23 | 25 | ||
24 | let buf = pre_process::strip_irrelevant_content(&buf); | 26 | let buf = pre_process::strip_irrelevant_content(&buf); |
25 | } | 27 | } |