Skip to content

Commit a27741b

Browse files
committed
Merge branch 'main' into performance
2 parents 078f6ff + b13bafa commit a27741b

File tree

6 files changed

+168
-115
lines changed

6 files changed

+168
-115
lines changed

Cargo.lock

Lines changed: 64 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ edition = "2021"
1212
clap = { version = "4.5.2", features = ["derive"] }
1313
console = "0.15.8"
1414
glob = "0.3.0"
15-
home = "0.5.9"
1615
indicatif = "0.17.8"
1716
notify-debouncer-mini = "0.4.1"
1817
serde_json = "1.0.114"
1918
serde = { version = "1.0.197", features = ["derive"] }
20-
toml = "0.8.10"
19+
shlex = "1.3.0"
20+
toml_edit = { version = "0.22.9", default-features = false, features = ["parse", "serde"] }
21+
which = "6.0.1"
2122
winnow = "0.6.5"
2223

2324
[[bin]]

src/exercise.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::fmt::{self, Display, Formatter};
33
use std::fs::{self, remove_file, File};
44
use std::io::{self, BufRead, BufReader};
55
use std::path::PathBuf;
6-
use std::process::{self, exit, Command};
6+
use std::process::{self, exit, Command, Stdio};
77
use std::{array, env, mem};
88
use winnow::ascii::{space0, Caseless};
99
use winnow::combinator::opt;
@@ -72,7 +72,7 @@ pub struct Exercise {
7272

7373
// An enum to track of the state of an Exercise.
7474
// An Exercise can be either Done or Pending
75-
#[derive(PartialEq, Debug)]
75+
#[derive(PartialEq, Eq, Debug)]
7676
pub enum State {
7777
// The state of the exercise once it's been completed
7878
Done,
@@ -81,7 +81,7 @@ pub enum State {
8181
}
8282

8383
// The context information of a pending exercise
84-
#[derive(PartialEq, Debug)]
84+
#[derive(PartialEq, Eq, Debug)]
8585
pub struct ContextLine {
8686
// The source code that is still pending completion
8787
pub line: String,
@@ -162,7 +162,10 @@ path = "{}.rs""#,
162162
.args(RUSTC_COLOR_ARGS)
163163
.args(RUSTC_EDITION_ARGS)
164164
.args(RUSTC_NO_DEBUG_ARGS)
165-
.output()
165+
.stdin(Stdio::null())
166+
.stdout(Stdio::null())
167+
.stderr(Stdio::null())
168+
.status()
166169
.expect("Failed to compile!");
167170
// Due to an issue with Clippy, a cargo clean is required to catch all lints.
168171
// See https://github.com/rust-lang/rust-clippy/issues/2604
@@ -171,7 +174,10 @@ path = "{}.rs""#,
171174
Command::new("cargo")
172175
.args(["clean", "--manifest-path", CLIPPY_CARGO_TOML_PATH])
173176
.args(RUSTC_COLOR_ARGS)
174-
.output()
177+
.stdin(Stdio::null())
178+
.stdout(Stdio::null())
179+
.stderr(Stdio::null())
180+
.status()
175181
.expect("Failed to run 'cargo clean'");
176182
Command::new("cargo")
177183
.args(["clippy", "--manifest-path", CLIPPY_CARGO_TOML_PATH])

0 commit comments

Comments
 (0)