Add derive(Default)
to HashMapContext
This commit is contained in:
parent
e8578bf175
commit
c63206fa17
@ -19,7 +19,7 @@
|
|||||||
### Added
|
### Added
|
||||||
|
|
||||||
* Add serde support to `HashMapContext`
|
* Add serde support to `HashMapContext`
|
||||||
* Make `HashMapContext` derive default
|
* Make `HashMapContext` derive `Default` and `Debug`
|
||||||
|
|
||||||
### Changed
|
### 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.*
|
/// *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.
|
/// 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))]
|
#[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))]
|
||||||
pub struct HashMapContext {
|
pub struct HashMapContext {
|
||||||
variables: HashMap<String, Value>,
|
variables: HashMap<String, Value>,
|
||||||
@ -60,10 +60,7 @@ pub struct HashMapContext {
|
|||||||
impl HashMapContext {
|
impl HashMapContext {
|
||||||
/// Constructs a `HashMapContext` with no mappings.
|
/// Constructs a `HashMapContext` with no mappings.
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Default::default()
|
||||||
variables: Default::default(),
|
|
||||||
functions: Default::default(),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user