Remove html_debug! ()

It's not documented anywhere, and `cargo expand` does the same thing.
This commit is contained in:
Chris Wong 2022-10-27 15:29:04 +11:00 committed by GitHub
parent ce6a9f3bbd
commit 1fff8123eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 11 deletions

View file

@ -2,6 +2,9 @@
## [Unreleased] ## [Unreleased]
- Remove `html_debug!`
[#357](https://github.com/lambda-fairy/maud/pull/357)
## [0.24.0] - 2022-08-12 ## [0.24.0] - 2022-08-12
- Remove blanket `Render` impl for `T: Display` - Remove blanket `Render` impl for `T: Display`

View file

@ -96,7 +96,7 @@ fn render_complicated_template(b: &mut test::Bencher) {
b.iter(|| { b.iter(|| {
use crate::btn::{Button, RequestMethod}; use crate::btn::{Button, RequestMethod};
layout( layout(
format!("Homepage of {}", year), format!("Homepage of {year}"),
html! { html! {
h1 { "Hello there!" } h1 { "Hello there!" }

View file

@ -14,7 +14,7 @@ extern crate alloc;
use alloc::{borrow::Cow, boxed::Box, string::String}; use alloc::{borrow::Cow, boxed::Box, string::String};
use core::fmt::{self, Arguments, Display, Write}; use core::fmt::{self, Arguments, Display, Write};
pub use maud_macros::{html, html_debug}; pub use maud_macros::html;
mod escape; mod escape;

View file

@ -121,6 +121,6 @@ fn splice_with_path() {
#[test] #[test]
fn nested_macro_invocation() { fn nested_macro_invocation() {
let best_pony = "Pinkie Pie"; 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"); assert_eq!(result.into_string(), "Pinkie Pie is best pony");
} }

View file

@ -20,14 +20,6 @@ pub fn html(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
expand(input.into()).into() 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 { fn expand(input: TokenStream) -> TokenStream {
let output_ident = TokenTree::Ident(Ident::new("__maud_output", Span::mixed_site())); let output_ident = TokenTree::Ident(Ident::new("__maud_output", Span::mixed_site()));
// Heuristic: the size of the resulting markup tends to correlate with the // Heuristic: the size of the resulting markup tends to correlate with the