refactor: change from match to if for NO_EMOJI

This commit is contained in:
Matt Lebl
2021-03-20 11:52:57 -07:00
parent 8d62a99637
commit 01e7f27aa6
3 changed files with 37 additions and 40 deletions

View File

@@ -127,9 +127,10 @@ name = "{}"
path = "{}.rs""#,
self.name, self.name, self.name
);
let cargo_toml_error_msg = match env::var("NO_EMOJI").is_ok() {
true => "Failed to write Clippy Cargo.toml file.",
false => "Failed to write 📎 Clippy 📎 Cargo.toml file."
let cargo_toml_error_msg = if env::var("NO_EMOJI").is_ok() {
"Failed to write Clippy Cargo.toml file."
} else {
"Failed to write 📎 Clippy 📎 Cargo.toml file."
};
fs::write(CLIPPY_CARGO_TOML_PATH, cargo_toml)
.expect(cargo_toml_error_msg);