Add derive(Default)
to HashMapContext
This commit is contained in:
parent
e8578bf175
commit
c63206fa17
@ -19,7 +19,7 @@
|
||||
### Added
|
||||
|
||||
* Add serde support to `HashMapContext`
|
||||
* Make `HashMapContext` derive default
|
||||
* Make `HashMapContext` derive `Default` and `Debug`
|
||||
|
||||
### Changed
|
||||
|
||||
|
@ -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<String, Value>,
|
||||
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user