mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-25 14:57:32 -05:00
Add deny_unknown_fields
This commit is contained in:
parent
b3642b0219
commit
27e9520665
2 changed files with 3 additions and 0 deletions
|
@ -46,6 +46,7 @@ pub enum Mode {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
|
#[serde(deny_unknown_fields)]
|
||||||
pub struct InfoFile {
|
pub struct InfoFile {
|
||||||
pub exercises: Vec<Exercise>,
|
pub exercises: Vec<Exercise>,
|
||||||
}
|
}
|
||||||
|
@ -65,6 +66,7 @@ impl InfoFile {
|
||||||
|
|
||||||
// Deserialized from the `info.toml` file.
|
// Deserialized from the `info.toml` file.
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
|
#[serde(deny_unknown_fields)]
|
||||||
pub struct Exercise {
|
pub struct Exercise {
|
||||||
// Name of the exercise
|
// Name of the exercise
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
|
|
@ -5,6 +5,7 @@ use std::fs;
|
||||||
use crate::exercise::Exercise;
|
use crate::exercise::Exercise;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
|
#[serde(deny_unknown_fields)]
|
||||||
pub struct StateFile {
|
pub struct StateFile {
|
||||||
next_exercise_ind: usize,
|
next_exercise_ind: usize,
|
||||||
progress: Vec<bool>,
|
progress: Vec<bool>,
|
||||||
|
|
Loading…
Reference in a new issue