summaryrefslogtreecommitdiff
path: root/src/info_file.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/info_file.rs')
-rw-r--r--src/info_file.rs22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/info_file.rs b/src/info_file.rs
index 6938cd0..dbe4f08 100644
--- a/src/info_file.rs
+++ b/src/info_file.rs
@@ -2,18 +2,6 @@ use anyhow::{bail, Context, Error, Result};
use serde::Deserialize;
use std::{fs, io::ErrorKind};
-// The mode of the exercise.
-#[derive(Deserialize, Copy, Clone)]
-#[serde(rename_all = "lowercase")]
-pub enum Mode {
- // The exercise should be compiled as a binary
- Run,
- // The exercise should be compiled as a test harness
- Test,
- // The exercise should be linted with clippy
- Clippy,
-}
-
// Deserialized from the `info.toml` file.
#[derive(Deserialize)]
pub struct ExerciseInfo {
@@ -21,11 +9,17 @@ pub struct ExerciseInfo {
pub name: String,
// The exercise's directory inside the `exercises` directory
pub dir: Option<String>,
- // The mode of the exercise
- pub mode: Mode,
+ #[serde(default = "default_true")]
+ pub test: bool,
+ #[serde(default)]
+ pub strict_clippy: bool,
// The hint text associated with the exercise
pub hint: String,
}
+#[inline]
+const fn default_true() -> bool {
+ true
+}
impl ExerciseInfo {
pub fn path(&self) -> String {