summaryrefslogtreecommitdiff
path: root/dhall
diff options
context:
space:
mode:
authorNadrieril2019-03-09 14:32:07 +0100
committerNadrieril2019-03-09 14:32:07 +0100
commite27adcdce55dc15c97bb0ac6d5bc0b082d2232c2 (patch)
tree0b9580165db1bde863bc4cff619593fbce5bf4c3 /dhall
parentd8b69acc45334743c848a3d8b7689729d89eaf3a (diff)
Use new Label type instead of &str in parser
Diffstat (limited to 'dhall')
-rw-r--r--dhall/src/imports.rs2
-rw-r--r--dhall/src/main.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/dhall/src/imports.rs b/dhall/src/imports.rs
index 9ae66a7..d9f0b33 100644
--- a/dhall/src/imports.rs
+++ b/dhall/src/imports.rs
@@ -75,7 +75,7 @@ pub fn load_dhall_file(
let mut buffer = String::new();
File::open(f)?.read_to_string(&mut buffer)?;
let expr = parser::parse_expr(&*buffer)?;
- let expr = expr.take_ownership_of_labels();
+ let expr = expr.map_label(&|l| String::from(l.clone()));
let expr = if resolve_imports {
let root = ImportRoot::LocalDir(f.parent().unwrap().to_owned());
let resolve = |import: &Import| -> Expr<String, X, X> {
diff --git a/dhall/src/main.rs b/dhall/src/main.rs
index d072fe7..db69a46 100644
--- a/dhall/src/main.rs
+++ b/dhall/src/main.rs
@@ -65,8 +65,8 @@ fn main() {
}
};
- let expr: Expr<String, _, _> =
- imports::panic_imports(&expr.take_ownership_of_labels());
+ let expr: Expr<Label, _, _> =
+ imports::panic_imports(&expr);
let type_expr = match typecheck::type_of(&expr) {
Err(e) => {