From 933517880b85e524378aaa4240f82a41e8c8d280 Mon Sep 17 00:00:00 2001 From: Serhiy Barhamon Date: Wed, 29 Nov 2023 21:43:27 +0100 Subject: [PATCH] hotfix (#53) --- src/nodes/heading.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/nodes/heading.rs b/src/nodes/heading.rs index 12c3dcc..60bb546 100644 --- a/src/nodes/heading.rs +++ b/src/nodes/heading.rs @@ -12,9 +12,10 @@ use crate::toolkit::{ use super::{anchor::Anchor, text::Text}; #[derive(Debug, PartialEq, Serialize, Clone)] +#[serde(tag = "type")] pub enum HeadingNodes { Text(Text), - Anchor(Anchor), + A(Anchor), } impl From for HeadingNodes { @@ -25,7 +26,7 @@ impl From for HeadingNodes { impl From for HeadingNodes { fn from(anchor: Anchor) -> Self { - Self::Anchor(anchor) + Self::A(anchor) } } @@ -33,7 +34,7 @@ impl Node for HeadingNodes { fn len(&self) -> usize { match self { Self::Text(text) => text.len(), - Self::Anchor(anchor) => anchor.len(), + Self::A(anchor) => anchor.len(), } } } @@ -42,7 +43,7 @@ impl Display for HeadingNodes { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::Text(text) => write!(f, "{}", text), - Self::Anchor(anchor) => write!(f, "{}", anchor), + Self::A(anchor) => write!(f, "{}", anchor), } } }