Browse Source

Collapse nested if block

master
Stephen 3 months ago
parent
commit
5f07b4ea1f
1 changed files with 6 additions and 9 deletions
  1. +6
    -9
      src/lol.rs

+ 6
- 9
src/lol.rs View File

@ -33,17 +33,14 @@ pub fn print_rainbow(line: &str, freq: f64, seed: f64, spread: f64, invert: bool
{
exit(0);
}
} else {
if stdout()
.write_all(
format!("{}\x1B[{}m{}\x1B[39m", &c[1], color.to_fg_str(), &c[2]).as_bytes(),
)
.is_err()
{
exit(0);
}
} else if stdout()
.write_all(format!("{}\x1B[{}m{}\x1B[39m", &c[1], color.to_fg_str(), &c[2]).as_bytes())
.is_err()
{
exit(0);
}
}
if stdout().write_all(&[b'\n']).is_err() {
exit(0);
}


Loading…
Cancel
Save