From f28dac1093c068de198f194d6fa91ccf54d6d33e Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Mon, 16 Sep 2024 22:30:24 -0400 Subject: [PATCH] chore: remove unused debug info from `HtmlElement` --- tachys/src/html/element/custom.rs | 2 -- tachys/src/html/element/elements.rs | 15 +-------------- tachys/src/html/element/mod.rs | 14 -------------- tachys/src/mathml/mod.rs | 16 ++-------------- tachys/src/svg/mod.rs | 2 -- 5 files changed, 3 insertions(+), 46 deletions(-) diff --git a/tachys/src/html/element/custom.rs b/tachys/src/html/element/custom.rs index 3c8347e3e..fdb670b3a 100644 --- a/tachys/src/html/element/custom.rs +++ b/tachys/src/html/element/custom.rs @@ -17,8 +17,6 @@ where rndr: PhantomData, attributes: (), children: (), - #[cfg(debug_assertions)] - defined_at: std::panic::Location::caller(), } } diff --git a/tachys/src/html/element/elements.rs b/tachys/src/html/element/elements.rs index 210798aa6..f1a632ea0 100644 --- a/tachys/src/html/element/elements.rs +++ b/tachys/src/html/element/elements.rs @@ -35,8 +35,6 @@ macro_rules! html_element_inner { attributes: (), children: (), rndr: PhantomData, - #[cfg(debug_assertions)] - defined_at: std::panic::Location::caller() } } @@ -63,17 +61,12 @@ macro_rules! html_element_inner { At: NextTuple, ::Output], V, Rndr>>: Attribute, { - let HtmlElement { tag, rndr, children, attributes, - #[cfg(debug_assertions)] - defined_at - } = self; + let HtmlElement { tag, rndr, children, attributes } = self; HtmlElement { tag, rndr, children, attributes: attributes.next_tuple($crate::html::attribute::$attr(value)), - #[cfg(debug_assertions)] - defined_at } } )* @@ -161,8 +154,6 @@ macro_rules! html_self_closing_elements { children: (), rndr: PhantomData, tag: [<$tag:camel>], - #[cfg(debug_assertions)] - defined_at: std::panic::Location::caller() } } @@ -191,16 +182,12 @@ macro_rules! html_self_closing_elements { { let HtmlElement { tag, rndr, children, attributes, - #[cfg(debug_assertions)] - defined_at } = self; HtmlElement { tag, rndr, children, attributes: attributes.next_tuple($crate::html::attribute::$attr(value)), - #[cfg(debug_assertions)] - defined_at } } )* diff --git a/tachys/src/html/element/mod.rs b/tachys/src/html/element/mod.rs index 15ca66939..9715e19be 100644 --- a/tachys/src/html/element/mod.rs +++ b/tachys/src/html/element/mod.rs @@ -32,8 +32,6 @@ pub struct HtmlElement { pub(crate) rndr: PhantomData, pub(crate) attributes: At, pub(crate) children: Ch, - #[cfg(debug_assertions)] - pub(crate) defined_at: &'static std::panic::Location<'static>, } impl Clone @@ -45,8 +43,6 @@ impl Clone rndr: PhantomData, attributes: self.attributes.clone(), children: self.children.clone(), - #[cfg(debug_assertions)] - defined_at: self.defined_at, } } } @@ -85,16 +81,12 @@ where rndr, attributes, children, - #[cfg(debug_assertions)] - defined_at, } = self; HtmlElement { tag, rndr, attributes, children: children.next_tuple(child), - #[cfg(debug_assertions)] - defined_at, } } } @@ -122,16 +114,12 @@ where attributes, children, rndr, - #[cfg(debug_assertions)] - defined_at, } = self; HtmlElement { tag, attributes: attributes.add_any_attr(attr), children, rndr, - #[cfg(debug_assertions)] - defined_at, } } } @@ -262,8 +250,6 @@ where rndr: PhantomData, attributes, children, - #[cfg(debug_assertions)] - defined_at: self.defined_at, } } diff --git a/tachys/src/mathml/mod.rs b/tachys/src/mathml/mod.rs index 43119a2f3..779082d76 100644 --- a/tachys/src/mathml/mod.rs +++ b/tachys/src/mathml/mod.rs @@ -26,17 +26,12 @@ macro_rules! mathml_global { At: NextTuple, ::Output], V, Rndr>>: Attribute, { - let HtmlElement { tag, rndr, children, attributes, - #[cfg(debug_assertions)] - defined_at - } = self; + let HtmlElement { tag, rndr, children, attributes } = self; HtmlElement { tag, rndr, children, attributes: attributes.next_tuple($crate::html::attribute::$attr(value)), - #[cfg(debug_assertions)] - defined_at } } } @@ -59,8 +54,6 @@ macro_rules! mathml_elements { attributes: (), children: (), rndr: PhantomData, - #[cfg(debug_assertions)] - defined_at: std::panic::Location::caller() } } @@ -95,17 +88,12 @@ macro_rules! mathml_elements { At: NextTuple, ::Output], V, Rndr>>: Attribute, { - let HtmlElement { tag, rndr, children, attributes, - #[cfg(debug_assertions)] - defined_at - } = self; + let HtmlElement { tag, rndr, children, attributes } = self; HtmlElement { tag, rndr, children, attributes: attributes.next_tuple($crate::html::attribute::$attr(value)), - #[cfg(debug_assertions)] - defined_at } } )* diff --git a/tachys/src/svg/mod.rs b/tachys/src/svg/mod.rs index e6f227b62..e8c2b4b60 100644 --- a/tachys/src/svg/mod.rs +++ b/tachys/src/svg/mod.rs @@ -27,8 +27,6 @@ macro_rules! svg_elements { attributes: (), children: (), rndr: PhantomData, - #[cfg(debug_assertions)] - defined_at: std::panic::Location::caller() } }