aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO1
-rw-r--r--src/lib.rs10
2 files changed, 10 insertions, 1 deletions
diff --git a/TODO b/TODO
index ea0c0cd..06f475e 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,7 @@
Rework Config struct
Use Config values in assigning the build_dir location
Use Config values for check_path()
+"for s in v {" needs to push the surrounding text to the string
In files
- NEED TO FOR LOOP ON COMMANDS AND FILES PREFIXES
diff --git a/src/lib.rs b/src/lib.rs
index 3e4bad2..17b1c6f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -213,8 +213,16 @@ impl S3G {
// File scanning
let mut file_string = String::new();
+
+ let string = match fs::read_to_string(&path) {
+ Ok(n) => n,
+ Err(_) => {
+ println!("Could not read file at: \"{}\", Continuing", &path.to_str().unwrap());
+ String::from("")
+ }
+ };
- for line in fs::read_to_string(&path).unwrap().lines() {
+ for line in string.lines() {
// NEED TO FOR LOOP ON COMMANDS AND FILES PREFIXES
if line.contains(":?") {