diff options
author | Nadrieril | 2019-03-16 22:41:22 +0100 |
---|---|---|
committer | Nadrieril | 2019-03-16 22:41:22 +0100 |
commit | 0f33caf4c1ee4d1f95d6ac3a41b5cf2f8efa7b54 (patch) | |
tree | 36607a1eb1eaf327388d2026d192782cdb6d130d /dhall_generator | |
parent | 5692bf2c8a7acfb90a5d03d0bd360c105ba2a72b (diff) |
Use Box more uniformly in AST
Closes #28
Diffstat (limited to 'dhall_generator')
-rw-r--r-- | dhall_generator/src/lib.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/dhall_generator/src/lib.rs b/dhall_generator/src/lib.rs index 1d51f9e..1a74f4f 100644 --- a/dhall_generator/src/lib.rs +++ b/dhall_generator/src/lib.rs @@ -125,12 +125,14 @@ fn label_to_tokenstream(l: &Label) -> TokenStream { } fn map_to_tokenstream( - m: &BTreeMap<Label, Expr<X, X>>, + m: &BTreeMap<Label, Box<Expr<X, X>>>, ctx: &Context<Label, ()>, ) -> TokenStream { let (keys, values): (Vec<TokenStream>, Vec<TokenStream>) = m .iter() - .map(|(k, v)| (label_to_tokenstream(k), dhall_to_tokenstream(v, ctx))) + .map(|(k, v)| { + (label_to_tokenstream(k), dhall_to_tokenstream_bx(&*v, ctx)) + }) .unzip(); quote! { { let mut m = BTreeMap::new(); @@ -151,10 +153,10 @@ fn option_to_tokenstream( } fn vec_to_tokenstream( - e: &Vec<Expr<X, X>>, + e: &Vec<Box<Expr<X, X>>>, ctx: &Context<Label, ()>, ) -> TokenStream { - let e = e.iter().map(|x| dhall_to_tokenstream(x, ctx)); + let e = e.iter().map(|x| dhall_to_tokenstream_bx(&**x, ctx)); quote! { vec![ #(#e),* ] } } |