static text

This commit is contained in:
2024-12-17 11:40:46 +01:00
parent e1ad3a58b0
commit 8182e70ca4
3 changed files with 22 additions and 14 deletions
+11 -11
View File
@@ -104,17 +104,6 @@ pub enum Children {
Children(Vec<Element>, usize),
}
impl std::fmt::Debug for Children {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&match self {
Self::None => String::new(),
Self::Children(a, b) => format!("({b}, {a:?})"),
Self::Text(a) => format!("{:?}", a()),
Self::StaticText(a) => format!("{a:?}"),
})
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////
/// Implementations
//////////////////////////////////////////////////////////////////////////////////////////////////
@@ -209,6 +198,17 @@ impl Default for Children {
}
}
impl std::fmt::Debug for Children {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&match self {
Self::None => String::new(),
Self::Children(a, b) => format!("({b}, {a:?})"),
Self::Text(a) => format!("{:?}", a()),
Self::StaticText(a) => format!("static({a:?})"),
})
}
}
impl Children {
pub fn is_none(&self) -> bool {
match self {