Skip to content
Snippets Groups Projects
Commit 5f07b4ea authored by Stephen D's avatar Stephen D
Browse files

Collapse nested if block

parent 7d2cc76f
No related branches found
No related tags found
No related merge requests found
...@@ -33,17 +33,14 @@ pub fn print_rainbow(line: &str, freq: f64, seed: f64, spread: f64, invert: bool ...@@ -33,17 +33,14 @@ pub fn print_rainbow(line: &str, freq: f64, seed: f64, spread: f64, invert: bool
{ {
exit(0); exit(0);
} }
} else { } else if stdout()
if stdout() .write_all(format!("{}\x1B[{}m{}\x1B[39m", &c[1], color.to_fg_str(), &c[2]).as_bytes())
.write_all( .is_err()
format!("{}\x1B[{}m{}\x1B[39m", &c[1], color.to_fg_str(), &c[2]).as_bytes(), {
) exit(0);
.is_err()
{
exit(0);
}
} }
} }
if stdout().write_all(&[b'\n']).is_err() { if stdout().write_all(&[b'\n']).is_err() {
exit(0); exit(0);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment