mirror of
https://github.com/rust-lang/rustlings
synced 2024-11-03 03:40:13 +00:00
Add deny_unknown_fields
This commit is contained in:
parent
b3642b0219
commit
27e9520665
@ -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 New Issue
Block a user