summaryrefslogtreecommitdiff
path: root/dhall_syntax
diff options
context:
space:
mode:
authorNadrieril2019-05-09 16:56:17 +0200
committerNadrieril2019-05-09 16:56:17 +0200
commitbf74436781a1304a937fb31a50c5495223468087 (patch)
tree06df62ab914c39e3572e9729c9b1088eec549741 /dhall_syntax
parent32051979778436ea02cb406551f126fe22ea1636 (diff)
Small utility SubExpr::from_builtin
Diffstat (limited to 'dhall_syntax')
-rw-r--r--dhall_syntax/src/core/expr.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/dhall_syntax/src/core/expr.rs b/dhall_syntax/src/core/expr.rs
index 3b73d88..c509bae 100644
--- a/dhall_syntax/src/core/expr.rs
+++ b/dhall_syntax/src/core/expr.rs
@@ -338,6 +338,10 @@ impl<N, E> SubExpr<N, E> {
SubExpr(Rc::new((x, None)))
}
+ pub fn from_builtin(b: Builtin) -> Self {
+ SubExpr::from_expr_no_note(ExprF::Builtin(b))
+ }
+
pub fn rewrap<E2>(&self, x: Expr<N, E2>) -> SubExpr<N, E2>
where
N: Clone,