From efe4b340bebaa7ef8bce6e69194959b126c5fade Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 10 Apr 2020 12:10:53 +0100 Subject: Deserialize `Prelude.Map` and `toMap` to a map instead of a list --- dhall/src/operations/normalization.rs | 4 ++-- dhall/src/operations/typecheck.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'dhall/src/operations') diff --git a/dhall/src/operations/normalization.rs b/dhall/src/operations/normalization.rs index e3a9415..86fed13 100644 --- a/dhall/src/operations/normalization.rs +++ b/dhall/src/operations/normalization.rs @@ -226,11 +226,11 @@ pub fn normalize_operation(opkind: &OpKind) -> Ret { Some(h) => ret_kind(h.app_to_kind(v.clone())), None => nothing_to_do(), }, - EmptyOptionalLit(_) => match kvs.get(&"None".into()) { + EmptyOptionalLit(_) => match kvs.get("None") { Some(h) => ret_ref(h), None => nothing_to_do(), }, - NEOptionalLit(v) => match kvs.get(&"Some".into()) { + NEOptionalLit(v) => match kvs.get("Some") { Some(h) => ret_kind(h.app_to_kind(v.clone())), None => nothing_to_do(), }, diff --git a/dhall/src/operations/typecheck.rs b/dhall/src/operations/typecheck.rs index 91d5059..314c587 100644 --- a/dhall/src/operations/typecheck.rs +++ b/dhall/src/operations/typecheck.rs @@ -398,11 +398,11 @@ pub fn typecheck_operation( if kts.len() != 2 { return span_err(err_msg); } - match kts.get(&"mapKey".into()) { + match kts.get("mapKey") { Some(t) if *t == Nir::from_builtin(Builtin::Text) => {} _ => return span_err(err_msg), } - match kts.get(&"mapValue".into()) { + match kts.get("mapValue") { Some(_) => {} None => return span_err(err_msg), } @@ -434,7 +434,7 @@ pub fn typecheck_operation( } Field(scrut, x) => { match scrut.ty().kind() { - RecordType(kts) => match kts.get(&x) { + RecordType(kts) => match kts.get(x) { Some(val) => Type::new_infer_universe(env, val.clone())?, None => return span_err("MissingRecordField"), }, -- cgit v1.2.3