summaryrefslogtreecommitdiff
path: root/dhall/src/semantics/resolve/env.rs
diff options
context:
space:
mode:
Diffstat (limited to 'dhall/src/semantics/resolve/env.rs')
-rw-r--r--dhall/src/semantics/resolve/env.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/dhall/src/semantics/resolve/env.rs b/dhall/src/semantics/resolve/env.rs
index d5bb15b..d7ff0ae 100644
--- a/dhall/src/semantics/resolve/env.rs
+++ b/dhall/src/semantics/resolve/env.rs
@@ -5,7 +5,7 @@ use crate::semantics::{AlphaVar, ImportLocation, TypedHir, VarEnv};
use crate::syntax::{Label, V};
/// Environment for resolving names.
-#[derive(Debug, Clone)]
+#[derive(Debug, Clone, Default)]
pub struct NameEnv {
names: Vec<Label>,
}
@@ -14,7 +14,7 @@ pub type ImportCache = HashMap<ImportLocation, TypedHir>;
pub type ImportStack = Vec<ImportLocation>;
/// Environment for resolving imports
-#[derive(Debug, Clone)]
+#[derive(Debug, Clone, Default)]
pub struct ImportEnv {
cache: ImportCache,
stack: ImportStack,
@@ -22,7 +22,7 @@ pub struct ImportEnv {
impl NameEnv {
pub fn new() -> Self {
- NameEnv { names: Vec::new() }
+ NameEnv::default()
}
pub fn as_varenv(&self) -> VarEnv {
VarEnv::from_size(self.names.len())
@@ -66,10 +66,7 @@ impl NameEnv {
impl ImportEnv {
pub fn new() -> Self {
- ImportEnv {
- cache: HashMap::new(),
- stack: Vec::new(),
- }
+ ImportEnv::default()
}
pub fn handle_import(