From 7d30b044a2c8c2cef8143b9e0ac763024c50026c Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 24 Mar 2019 01:06:40 +0100 Subject: Refactor printer Avoids stupid stack overflows when adding variants, gets precedences right, and updates to latest grammar changes --- dhall_generator/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dhall_generator') 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() } } -- cgit v1.2.3