Add deny_unknown_fields

This commit is contained in:
mo8it 2024-04-10 14:40:49 +02:00
parent b3642b0219
commit 27e9520665
2 changed files with 3 additions and 0 deletions

View File

@ -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,

View File

@ -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>,