summaryrefslogtreecommitdiff
path: root/src/exercise.rs
diff options
context:
space:
mode:
authormokou <mokou@fastmail.com>2021-04-20 12:46:49 +0200
committermokou <mokou@fastmail.com>2021-04-21 10:08:26 +0200
commit7928122fcef9ca7834d988b1ec8ca0687478beeb (patch)
tree4a6ae0d25d6d27985bb5e1d0a0627c2f2b5299af /src/exercise.rs
parentaa0db8379c47ead06725e9f3fd320f7e8bd95ecc (diff)
feat: Replace clap with argh
I’ve been wanting to do this for a while, but always procrastinated on it. We’ve been using Clap since the 2.0 rewrite, but Clap is known to be a fairly heavy library. Since Rustlings is usually peoples’ first contact with a Rust compilation, I think it’s in our best interests that this complation is as fast as possible. In effect, replacing Clap with the smaller, structopt-style `argh` reduces the amount of crates needing to be compiled from 82 to 60. I also think this makes the code way easier to read, we don’t need to use Clap’s methods anymore, but can switch over to using pure Rust methods, e.g., switches are booleans, options are Option<String>s or the like, and subcommands are just structs.
Diffstat (limited to 'src/exercise.rs')
-rw-r--r--src/exercise.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/exercise.rs b/src/exercise.rs
index e9d1c1c..d934cfd 100644
--- a/src/exercise.rs
+++ b/src/exercise.rs
@@ -24,7 +24,7 @@ fn temp_file() -> String {
}
// The mode of the exercise.
-#[derive(Deserialize, Copy, Clone)]
+#[derive(Deserialize, Copy, Clone, Debug)]
#[serde(rename_all = "lowercase")]
pub enum Mode {
// Indicates that the exercise should be compiled as a binary
@@ -42,7 +42,7 @@ pub struct ExerciseList {
// A representation of a rustlings exercise.
// This is deserialized from the accompanying info.toml file
-#[derive(Deserialize)]
+#[derive(Deserialize, Debug)]
pub struct Exercise {
// Name of the exercise
pub name: String,