diff options
| author | mo8it <mo8it@proton.me> | 2024-04-10 14:40:49 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-04-10 14:40:49 +0200 |
| commit | 27e95206658e8f86cad351ce163f03c0d36e05ea (patch) | |
| tree | 60c27f81f648e9074f7adeec065c935929b8124b | |
| parent | b3642b0219252e97213fd4348379f272a3002f39 (diff) | |
Add deny_unknown_fields
| -rw-r--r-- | src/exercise.rs | 2 | ||||
| -rw-r--r-- | src/state_file.rs | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/exercise.rs b/src/exercise.rs index 232d7f9..ca47009 100644 --- a/src/exercise.rs +++ b/src/exercise.rs @@ -46,6 +46,7 @@ pub enum Mode { } #[derive(Deserialize)] +#[serde(deny_unknown_fields)] pub struct InfoFile { pub exercises: Vec<Exercise>, } @@ -65,6 +66,7 @@ impl InfoFile { // Deserialized from the `info.toml` file. #[derive(Deserialize)] +#[serde(deny_unknown_fields)] pub struct Exercise { // Name of the exercise pub name: String, diff --git a/src/state_file.rs b/src/state_file.rs index 583e043..6b80354 100644 --- a/src/state_file.rs +++ b/src/state_file.rs @@ -5,6 +5,7 @@ use std::fs; use crate::exercise::Exercise; #[derive(Serialize, Deserialize)] +#[serde(deny_unknown_fields)] pub struct StateFile { next_exercise_ind: usize, progress: Vec<bool>, |
