summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorÉtienne Barrié <etienne.barrie@gmail.com>2020-08-10 10:42:54 -0400
committerÉtienne Barrié <etienne.barrie@gmail.com>2020-08-10 10:42:54 -0400
commit81f8c2f83c6bb5c239fd2e0cf856d1535692af3f (patch)
tree0710683da6637b251520b26a65b3a1c91a317f28 /src
parentc4853ee6bb2b3791ba04daf14105bfab2b53e79f (diff)
chore: Run cargo fmt
Diffstat (limited to 'src')
-rw-r--r--src/exercise.rs5
-rw-r--r--src/main.rs4
-rw-r--r--src/verify.rs6
3 files changed, 6 insertions, 9 deletions
diff --git a/src/exercise.rs b/src/exercise.rs
index 2108d81..e70538b 100644
--- a/src/exercise.rs
+++ b/src/exercise.rs
@@ -167,9 +167,10 @@ path = "{}.rs""#,
fn run(&self) -> Result<ExerciseOutput, ExerciseOutput> {
let arg = match self.mode {
Mode::Test => "--show-output",
- _ => ""
+ _ => "",
};
- let cmd = Command::new(&temp_file()).arg(arg)
+ let cmd = Command::new(&temp_file())
+ .arg(arg)
.output()
.expect("Failed to run 'run' command");
diff --git a/src/main.rs b/src/main.rs
index 0e1291c..b5814bf 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -126,9 +126,7 @@ fn main() {
);
println!();
println!("We hope you enjoyed learning about the various aspects of Rust!");
- println!(
- "If you noticed any issues, please don't hesitate to report them to our repo."
- );
+ println!("If you noticed any issues, please don't hesitate to report them to our repo.");
println!("You can also contribute your own exercises to help the greater community!");
println!();
println!("Before reporting an issue or contributing, please read our guidelines:");
diff --git a/src/verify.rs b/src/verify.rs
index 807bea9..00e45c8 100644
--- a/src/verify.rs
+++ b/src/verify.rs
@@ -9,7 +9,7 @@ use indicatif::ProgressBar;
// determines whether or not the test harness outputs are displayed.
pub fn verify<'a>(
start_at: impl IntoIterator<Item = &'a Exercise>,
- verbose: bool
+ verbose: bool,
) -> Result<(), &'a Exercise> {
for exercise in start_at {
let compile_result = match exercise.mode {
@@ -77,9 +77,7 @@ fn compile_and_run_interactively(exercise: &Exercise) -> Result<bool, ()> {
// Compile the given Exercise as a test harness and display
// the output if verbose is set to true
-fn compile_and_test(
- exercise: &Exercise, run_mode: RunMode, verbose: bool
-) -> Result<bool, ()> {
+fn compile_and_test(exercise: &Exercise, run_mode: RunMode, verbose: bool) -> Result<bool, ()> {
let progress_bar = ProgressBar::new_spinner();
progress_bar.set_message(format!("Testing {}...", exercise).as_str());
progress_bar.enable_steady_tick(100);