diff --git a/CHANGELOG.md b/CHANGELOG.md index 38b729b..510926b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ ### Added * Add serde support to `HashMapContext` - * Make `HashMapContext` derive default + * Make `HashMapContext` derive `Default` and `Debug` ### Changed diff --git a/src/context/mod.rs b/src/context/mod.rs index 8ab9c99..72694f1 100644 --- a/src/context/mod.rs +++ b/src/context/mod.rs @@ -49,7 +49,7 @@ impl Context for EmptyContext { /// *Value and function mappings are stored independently, meaning that there can be a function and a value with the same identifier.* /// /// This context is type-safe, meaning that an identifier that is assigned a value of some type once cannot be assigned a value of another type. -#[derive(Debug)] +#[derive(Debug, Default)] #[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))] pub struct HashMapContext { variables: HashMap, @@ -60,10 +60,7 @@ pub struct HashMapContext { impl HashMapContext { /// Constructs a `HashMapContext` with no mappings. pub fn new() -> Self { - Self { - variables: Default::default(), - functions: Default::default(), - } + Default::default() } }