diff --git a/src/exercise.rs b/src/exercise.rs index 3d2e38d1..e9d1c1c9 100644 --- a/src/exercise.rs +++ b/src/exercise.rs @@ -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; @@ -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 diff --git a/src/ui.rs b/src/ui.rs index cb073372..1ee46316 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -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!( "{} {}", @@ -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!( "{} {}", diff --git a/src/verify.rs b/src/verify.rs index 7a0e9ccd..b98598a8 100644 --- a/src/verify.rs +++ b/src/verify.rs @@ -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.