entry defaults

This commit is contained in:
Robin Appelman 2023-12-19 19:37:33 +01:00
commit 21e97bae76
4 changed files with 4 additions and 4 deletions

View file

@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize};
use std::ops::{Deref, DerefMut}; use std::ops::{Deref, DerefMut};
/// An array of entries (items that have the same key). /// An array of entries (items that have the same key).
#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize)] #[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize, Default)]
#[serde(transparent)] #[serde(transparent)]
pub struct Array(Vec<Entry>); pub struct Array(Vec<Entry>);

View file

@ -4,7 +4,7 @@ use std::borrow::Cow;
use std::ops::Deref; use std::ops::Deref;
/// A statement. /// A statement.
#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize)] #[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize, Default)]
#[serde(transparent)] #[serde(transparent)]
pub struct Statement(String); pub struct Statement(String);

View file

@ -10,7 +10,7 @@ use std::collections::HashMap;
use std::ops::{Deref, DerefMut}; use std::ops::{Deref, DerefMut};
/// A table of entries. /// A table of entries.
#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize)] #[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize, Default)]
#[serde(transparent)] #[serde(transparent)]
pub struct Table(#[serde(serialize_with = "ordered_map")] HashMap<String, Entry>); pub struct Table(#[serde(serialize_with = "ordered_map")] HashMap<String, Entry>);

View file

@ -8,7 +8,7 @@ use std::borrow::Cow;
use std::fmt::Formatter; use std::fmt::Formatter;
use std::ops::{Deref, DerefMut}; use std::ops::{Deref, DerefMut};
#[derive(Clone, PartialEq, Eq, Debug, Serialize)] #[derive(Clone, PartialEq, Eq, Debug, Serialize, Default)]
#[serde(transparent)] #[serde(transparent)]
pub struct Value(String); pub struct Value(String);