Skip to content

Commit

Permalink
Fix format_and_output
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Jul 20, 2021
1 parent 3e9ebd0 commit 8133d04
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,13 @@ fn format_and_output(filepath: &str, filetype: &str, raw: &str, fix: bool) {
let ignore = is_ignore_auto_correct(raw);

// print raw content and exist when ignore enable and not fix
if ignore && !fix {
println!("{}", raw);
std::process::exit(0);
} else {
return;
if ignore {
if fix {
return;
} else {
println!("{}", raw);
std::process::exit(0);
}
}

let result = match FILE_TYPES[filetype] {
Expand Down

0 comments on commit 8133d04

Please sign in to comment.