Skip to content

Commit

Permalink
Implemented Error Handling for hostnames with non-UTF-8 characters!
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBinitGhimire committed Jan 21, 2022
1 parent dd46f6c commit 21c5883
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ pub fn _fileRead(filepath: String) -> Vec<String> {
let reader = BufReader::new(file);
let mut hosts = Vec::<String>::new();
for line in reader.lines() {
hosts.push(line.unwrap());
match line {
Ok(line) => hosts.push(line),
Err(_) => ()
}
}
return hosts;
}
Expand Down

0 comments on commit 21c5883

Please sign in to comment.