summaryrefslogtreecommitdiff
path: root/dhall_generator/src
diff options
context:
space:
mode:
authorNadrieril2019-03-24 01:06:40 +0100
committerNadrieril2019-03-24 01:06:40 +0100
commit7d30b044a2c8c2cef8143b9e0ac763024c50026c (patch)
treecf6aa5f9af31edf77ac49a27083f53af2b6d2a30 /dhall_generator/src
parent062fc44a93a18ee432e51db852290ab5849f4dd9 (diff)
Refactor printer
Avoids stupid stack overflows when adding variants, gets precedences right, and updates to latest grammar changes
Diffstat (limited to 'dhall_generator/src')
-rw-r--r--dhall_generator/src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/dhall_generator/src/lib.rs b/dhall_generator/src/lib.rs
index 328bc3e..ee9af5e 100644
--- a/dhall_generator/src/lib.rs
+++ b/dhall_generator/src/lib.rs
@@ -102,12 +102,12 @@ fn dhall_to_tokenstream_bx(
match ctx.lookup(&s, *n) {
// Non-free variable; interpolates as itself
Some(()) => {
- let s: String = s.clone().into();
+ let s: String = s.into();
quote! { bx(Var(V(#s.into(), #n))) }
}
// Free variable; interpolates as a rust variable
None => {
- let s: String = s.clone().into();
+ let s: String = s.into();
// TODO: insert appropriate shifts ?
let v: TokenStream = s.parse().unwrap();
quote! { {
@@ -134,7 +134,7 @@ fn binop_to_tokenstream(b: BinOp) -> TokenStream {
}
fn label_to_tokenstream(l: &Label) -> TokenStream {
- let l = String::from(l.clone());
+ let l = String::from(l);
quote! { #l.into() }
}