From 75d52de47bb4fdee3c2b71505c433bfc34166b49 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 15 Apr 2019 00:06:28 +0200 Subject: Remove leftover bx() function --- dhall_core/src/core.rs | 7 +------ dhall_generator/src/quote.rs | 10 +++++----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/dhall_core/src/core.rs b/dhall_core/src/core.rs index 9c07ff7..7859c73 100644 --- a/dhall_core/src/core.rs +++ b/dhall_core/src/core.rs @@ -449,12 +449,7 @@ impl Clone for SubExpr { } } -// Remains of a previous life, where everything was in Boxes -pub fn bx(x: Expr) -> SubExpr { - SubExpr(Rc::new(x)) -} - -// Should probably rename this too +// Should probably rename this pub fn rc(x: Expr) -> SubExpr { SubExpr(Rc::new(x)) } diff --git a/dhall_generator/src/quote.rs b/dhall_generator/src/quote.rs index 2d2eada..89107a9 100644 --- a/dhall_generator/src/quote.rs +++ b/dhall_generator/src/quote.rs @@ -21,7 +21,7 @@ pub fn subexpr(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let no_import = |_: &Import| -> X { panic!("Don't use import in dhall::subexpr!()") }; let expr = expr.as_ref().map_embed(&no_import); - let output = quote_subexpr(&rc(expr), &Context::new()); + let output = quote_subexpr(&dhall_core::rc(expr), &Context::new()); output.into() } @@ -133,7 +133,7 @@ fn quote_subexpr( Some(()) => { let s: String = s.into(); let var = quote! { dhall_core::V(#s.into(), #n) }; - bx(quote! { dhall_core::ExprF::Var(#var) }) + rc(quote! { dhall_core::ExprF::Var(#var) }) } // Free variable; interpolates as a rust variable None => { @@ -147,7 +147,7 @@ fn quote_subexpr( } } } - e => bx(quote_exprf(e)), + e => rc(quote_exprf(e)), } } @@ -203,6 +203,6 @@ fn quote_label(l: &Label) -> TokenStream { quote! { dhall_core::Label::from(#l) } } -fn bx(x: TokenStream) -> TokenStream { - quote! { dhall_core::bx(#x) } +fn rc(x: TokenStream) -> TokenStream { + quote! { dhall_core::rc(#x) } } -- cgit v1.2.3