diff options
author | Nadrieril | 2019-09-03 16:43:45 +0200 |
---|---|---|
committer | Nadrieril | 2019-09-03 17:30:11 +0200 |
commit | 31a03bf9140a2fdf5eb52d0998d2d41efaf0d610 (patch) | |
tree | 3ec9b11a91e1306fc4fe67635fcaf0ab67a79a87 /dhall | |
parent | b263635ce54a28dc4598e0f2832a456eca7521fa (diff) |
Use map_mut in ValueF::normalize_mut
Diffstat (limited to '')
-rw-r--r-- | dhall/src/core/value.rs | 11 | ||||
-rw-r--r-- | dhall/src/core/valuef.rs | 7 |
2 files changed, 2 insertions, 16 deletions
diff --git a/dhall/src/core/value.rs b/dhall/src/core/value.rs index 3cccb1d..b4b6b08 100644 --- a/dhall/src/core/value.rs +++ b/dhall/src/core/value.rs @@ -212,17 +212,6 @@ impl Value { WHNF | NF => {} } } - pub(crate) fn normalize_nf(&self) { - let borrow = self.as_internal(); - match borrow.form { - Unevaled | WHNF => { - drop(borrow); - self.as_internal_mut().normalize_nf(); - } - // Already in NF - NF => {} - } - } pub(crate) fn app(&self, v: Value) -> Value { let body_t = match &*self.get_type_not_sort().as_whnf() { diff --git a/dhall/src/core/valuef.rs b/dhall/src/core/valuef.rs index 7ecec86..7a2b51c 100644 --- a/dhall/src/core/valuef.rs +++ b/dhall/src/core/valuef.rs @@ -189,7 +189,7 @@ impl ValueF { for x in elts.iter_mut() { use InterpolatedTextContents::{Expr, Text}; match x { - Expr(n) => n.normalize_mut(), + Expr(v) => v.normalize_mut(), Text(_) => {} } } @@ -199,10 +199,7 @@ impl ValueF { y.normalize_mut(); } ValueF::PartialExpr(e) => { - // TODO: need map_mut - e.map_ref(|v| { - v.normalize_nf(); - }); + e.map_mut(Value::normalize_mut); } } } |