diff options
author | Nadrieril | 2020-04-10 12:22:44 +0100 |
---|---|---|
committer | GitHub | 2020-04-10 12:22:44 +0100 |
commit | f78da0fb1f338123a226ec4d576b5329fffb5148 (patch) | |
tree | 627fa7b0b2b951efc4102d02e0a8f5a05e4aa03e /dhall/src/operations | |
parent | da80ef06a91e3869cc3c1d4dbd07259c408ff490 (diff) | |
parent | efe4b340bebaa7ef8bce6e69194959b126c5fade (diff) |
Merge pull request #160 from Nadrieril/toMap
Deserialize `Prelude.Map` and `toMap` to a map instead of a list
Diffstat (limited to 'dhall/src/operations')
-rw-r--r-- | dhall/src/operations/normalization.rs | 4 | ||||
-rw-r--r-- | dhall/src/operations/typecheck.rs | 6 |
2 files changed, 5 insertions, 5 deletions
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<Nir>) -> 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"), }, |