Make key and struct_field optional in DeserializerItem

The main point of this struct seems to be debugging,
as key_struct_field is unused except for debugging.
This commit is contained in:
est31 2019-09-02 02:43:07 +02:00
parent 6e0cb6b809
commit 5491b54859

View File

@ -4,8 +4,7 @@ use serde::{de, forward_to_deserialize_any};
#[derive(Debug)] #[derive(Debug)]
pub struct DeserializerItem<'de> { pub struct DeserializerItem<'de> {
key: String, key_struct_field: Option<(String, &'de str)>,
struct_field: &'de str,
val: Tagged<Value>, val: Tagged<Value>,
} }
@ -44,8 +43,7 @@ impl<'de> ConfigDeserializer<'de> {
trace!("pushing {:?}", value); trace!("pushing {:?}", value);
self.stack.push(DeserializerItem { self.stack.push(DeserializerItem {
key: name.to_string(), key_struct_field: Some((name.to_string(), name)),
struct_field: name,
val: value.unwrap_or_else(|| { val: value.unwrap_or_else(|| {
Value::nothing().tagged(Tag::unknown_origin(self.call.name_span)) Value::nothing().tagged(Tag::unknown_origin(self.call.name_span))
}), }),