Skip to content

Commit bd48544

Browse files
committed
style: formatted files with rustfmt
1 parent c0e3daa commit bd48544

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

src/exercise.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use std::env;
21
use regex::Regex;
32
use serde::Deserialize;
3+
use std::env;
44
use std::fmt::{self, Display, Formatter};
55
use std::fs::{self, remove_file, File};
66
use std::io::Read;
@@ -132,8 +132,7 @@ path = "{}.rs""#,
132132
} else {
133133
"Failed to write 📎 Clippy 📎 Cargo.toml file."
134134
};
135-
fs::write(CLIPPY_CARGO_TOML_PATH, cargo_toml)
136-
.expect(cargo_toml_error_msg);
135+
fs::write(CLIPPY_CARGO_TOML_PATH, cargo_toml).expect(cargo_toml_error_msg);
137136
// To support the ability to run the clipy exercises, build
138137
// an executable, in addition to running clippy. With a
139138
// compilation failure, this would silently fail. But we expect

src/ui.rs

+4-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
macro_rules! warn {
22
($fmt:literal, $ex:expr) => {{
3-
use std::env;
43
use console::{style, Emoji};
4+
use std::env;
55
let formatstr = format!($fmt, $ex);
66
if env::var("NO_EMOJI").is_ok() {
7-
println!(
8-
"{} {}",
9-
style("!").red(),
10-
style(formatstr).red()
11-
);
7+
println!("{} {}", style("!").red(), style(formatstr).red());
128
} else {
139
println!(
1410
"{} {}",
@@ -21,15 +17,11 @@ macro_rules! warn {
2117

2218
macro_rules! success {
2319
($fmt:literal, $ex:expr) => {{
24-
use std::env;
2520
use console::{style, Emoji};
21+
use std::env;
2622
let formatstr = format!($fmt, $ex);
2723
if env::var("NO_EMOJI").is_ok() {
28-
println!(
29-
"{} {}",
30-
style("✓").green(),
31-
style(formatstr).green()
32-
);
24+
println!("{} {}", style("✓").green(), style(formatstr).green());
3325
} else {
3426
println!(
3527
"{} {}",

src/verify.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use std::env;
21
use crate::exercise::{CompiledExercise, Exercise, Mode, State};
32
use console::style;
43
use indicatif::ProgressBar;
4+
use std::env;
55

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

0 commit comments

Comments
 (0)