mirror of
https://github.com/notohh/rustlings.git
synced 2024-12-22 00:18:09 -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)]
|
||||
#[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,
|
||||
|
|
|
@ -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>,
|
||||
|
|
Loading…
Reference in a new issue