From 1fff8123ebdaa093f6129867e6f5b3917129c183 Mon Sep 17 00:00:00 2001 From: Chris Wong Date: Thu, 27 Oct 2022 15:29:04 +1100 Subject: [PATCH] Remove `html_debug!` (#357) It's not documented anywhere, and `cargo expand` does the same thing. --- CHANGELOG.md | 3 +++ maud/benches/complicated_maud.rs | 2 +- maud/src/lib.rs | 2 +- maud/tests/splices.rs | 2 +- maud_macros/src/lib.rs | 8 -------- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71ce77b8..48d5a1e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## [Unreleased] +- Remove `html_debug!` + [#357](https://github.com/lambda-fairy/maud/pull/357) + ## [0.24.0] - 2022-08-12 - Remove blanket `Render` impl for `T: Display` diff --git a/maud/benches/complicated_maud.rs b/maud/benches/complicated_maud.rs index d0cf0958..6e0e45dd 100644 --- a/maud/benches/complicated_maud.rs +++ b/maud/benches/complicated_maud.rs @@ -96,7 +96,7 @@ fn render_complicated_template(b: &mut test::Bencher) { b.iter(|| { use crate::btn::{Button, RequestMethod}; layout( - format!("Homepage of {}", year), + format!("Homepage of {year}"), html! { h1 { "Hello there!" } diff --git a/maud/src/lib.rs b/maud/src/lib.rs index 0124cf94..67caaff2 100644 --- a/maud/src/lib.rs +++ b/maud/src/lib.rs @@ -14,7 +14,7 @@ extern crate alloc; use alloc::{borrow::Cow, boxed::Box, string::String}; use core::fmt::{self, Arguments, Display, Write}; -pub use maud_macros::{html, html_debug}; +pub use maud_macros::html; mod escape; diff --git a/maud/tests/splices.rs b/maud/tests/splices.rs index eb568547..d3fd511f 100644 --- a/maud/tests/splices.rs +++ b/maud/tests/splices.rs @@ -121,6 +121,6 @@ fn splice_with_path() { #[test] fn nested_macro_invocation() { let best_pony = "Pinkie Pie"; - let result = html! { (format!("{} is best pony", best_pony)) }; + let result = html! { (format!("{best_pony} is best pony")) }; assert_eq!(result.into_string(), "Pinkie Pie is best pony"); } diff --git a/maud_macros/src/lib.rs b/maud_macros/src/lib.rs index fe65ad4b..b1ccf2df 100644 --- a/maud_macros/src/lib.rs +++ b/maud_macros/src/lib.rs @@ -20,14 +20,6 @@ pub fn html(input: proc_macro::TokenStream) -> proc_macro::TokenStream { expand(input.into()).into() } -#[proc_macro] -#[proc_macro_error] -pub fn html_debug(input: proc_macro::TokenStream) -> proc_macro::TokenStream { - let expr = expand(input.into()); - println!("expansion:\n{}", expr); - expr.into() -} - fn expand(input: TokenStream) -> TokenStream { let output_ident = TokenTree::Ident(Ident::new("__maud_output", Span::mixed_site())); // Heuristic: the size of the resulting markup tends to correlate with the