Skip to content

Commit

Permalink
style: formatted files with rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Zerotask committed Apr 18, 2021
1 parent c0e3daa commit bd48544
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
5 changes: 2 additions & 3 deletions src/exercise.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::env;
use regex::Regex;
use serde::Deserialize;
use std::env;
use std::fmt::{self, Display, Formatter};
use std::fs::{self, remove_file, File};
use std::io::Read;
Expand Down Expand Up @@ -132,8 +132,7 @@ path = "{}.rs""#,
} else {
"Failed to write 📎 Clippy 📎 Cargo.toml file."
};
fs::write(CLIPPY_CARGO_TOML_PATH, cargo_toml)
.expect(cargo_toml_error_msg);
fs::write(CLIPPY_CARGO_TOML_PATH, cargo_toml).expect(cargo_toml_error_msg);
// To support the ability to run the clipy exercises, build
// an executable, in addition to running clippy. With a
// compilation failure, this would silently fail. But we expect
Expand Down
16 changes: 4 additions & 12 deletions src/ui.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
macro_rules! warn {
($fmt:literal, $ex:expr) => {{
use std::env;
use console::{style, Emoji};
use std::env;
let formatstr = format!($fmt, $ex);
if env::var("NO_EMOJI").is_ok() {
println!(
"{} {}",
style("!").red(),
style(formatstr).red()
);
println!("{} {}", style("!").red(), style(formatstr).red());
} else {
println!(
"{} {}",
Expand All @@ -21,15 +17,11 @@ macro_rules! warn {

macro_rules! success {
($fmt:literal, $ex:expr) => {{
use std::env;
use console::{style, Emoji};
use std::env;
let formatstr = format!($fmt, $ex);
if env::var("NO_EMOJI").is_ok() {
println!(
"{} {}",
style("✓").green(),
style(formatstr).green()
);
println!("{} {}", style("✓").green(), style(formatstr).green());
} else {
println!(
"{} {}",
Expand Down
2 changes: 1 addition & 1 deletion src/verify.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::env;
use crate::exercise::{CompiledExercise, Exercise, Mode, State};
use console::style;
use indicatif::ProgressBar;
use std::env;

// Verify that the provided container of Exercise objects
// can be compiled and run without any failures.
Expand Down

0 comments on commit bd48544

Please sign in to comment.