diff options
author | curly <curlybryce@protonmail.com> | 2023-01-04 12:29:50 -0700 |
---|---|---|
committer | curly <curlybryce@protonmail.com> | 2023-01-04 12:29:50 -0700 |
commit | 84778837a9d1347432b9879ed83e387506c2acfd (patch) | |
tree | 4d1fe41810ffe13d7694dd310cd0c4ad7108990a /src | |
parent | f7b43b2ee392d28f69964b00c7db98b4c87e3afe (diff) | |
download | s3g-84778837a9d1347432b9879ed83e387506c2acfd.tar.gz s3g-84778837a9d1347432b9879ed83e387506c2acfd.tar.bz2 s3g-84778837a9d1347432b9879ed83e387506c2acfd.zip |
handle file error
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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(":?") { |