This commit is contained in:
parent
75a0c21c01
commit
ff4f80c2c0
1 changed files with 7 additions and 1 deletions
|
@ -20,7 +20,13 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn process_file(path: &str, mode: &Mode) {
|
fn process_file(path: &str, mode: &Mode) {
|
||||||
let mut content = fs::read_to_string(path).expect("could not read file");
|
let mut content = match fs::read_to_string(path) {
|
||||||
|
Ok(content) => { content },
|
||||||
|
Err(error) => {
|
||||||
|
println!("\x1B[1m{}\x1B[0m: {}", path, error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if ends_with_newline(&content) {
|
if ends_with_newline(&content) {
|
||||||
match mode {
|
match mode {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue