diff options
author | Nadrieril | 2019-08-16 17:56:19 +0200 |
---|---|---|
committer | Nadrieril | 2019-08-16 18:01:46 +0200 |
commit | 88ebc0f9d561a2541aad84a3152511a0439db8b4 (patch) | |
tree | 73571d5509f8631da63c09ec78acd30862f237f9 /dhall/src/core/value.rs | |
parent | e8bf879471708ac2cc03df904d14a618daaf2132 (diff) |
Reduce api surface of dhall crate
Helps detect unused code
Diffstat (limited to '')
-rw-r--r-- | dhall/src/core/value.rs | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/dhall/src/core/value.rs b/dhall/src/core/value.rs index 19be56a..61a8eea 100644 --- a/dhall/src/core/value.rs +++ b/dhall/src/core/value.rs @@ -56,17 +56,17 @@ pub enum Value { } impl Value { - pub fn into_thunk(self) -> Thunk { + pub(crate) fn into_thunk(self) -> Thunk { Thunk::from_value(self) } /// Convert the value to a fully normalized syntactic expression - pub fn normalize_to_expr(&self) -> OutputSubExpr { + pub(crate) fn normalize_to_expr(&self) -> OutputSubExpr { self.normalize_to_expr_maybe_alpha(false) } /// Convert the value to a fully normalized syntactic expression. Also alpha-normalize /// if alpha is `true` - pub fn normalize_to_expr_maybe_alpha(&self, alpha: bool) -> OutputSubExpr { + pub(crate) fn normalize_to_expr_maybe_alpha(&self, alpha: bool) -> OutputSubExpr { match self { Value::Lam(x, t, e) => rc(ExprF::Lam( x.to_label_maybe_alpha(alpha), @@ -179,14 +179,7 @@ impl Value { } } - // Deprecated - pub fn normalize(&self) -> Value { - let mut v = self.clone(); - v.normalize_mut(); - v - } - - pub fn normalize_mut(&mut self) { + pub(crate) fn normalize_mut(&mut self) { match self { Value::Var(_) | Value::Const(_) @@ -264,12 +257,12 @@ impl Value { } /// Apply to a value - pub fn app(self, val: Value) -> Value { + pub(crate) fn app(self, val: Value) -> Value { self.app_val(val) } /// Apply to a value - pub fn app_val(self, val: Value) -> Value { + pub(crate) fn app_val(self, val: Value) -> Value { self.app_thunk(val.into_thunk()) } |