1
0
Fork 0
mirror of https://github.com/notohh/rustlings.git synced 2025-07-26 15:20:05 -04:00

refactor: change from match to if for NO_EMOJI

This commit is contained in:
Matt Lebl 2021-03-20 11:52:57 -07:00
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);