diff options
author | JJ | 2023-06-18 06:06:13 +0000 |
---|---|---|
committer | JJ | 2023-06-18 06:06:13 +0000 |
commit | 199ce602cd14cecec92d066eb9026aaebb435f70 (patch) | |
tree | 0d89bcecc4355224b53295f5f97e427a371944f0 /parse_wiki_text/src | |
parent | eee2567e8f9e2f8abf736c79ab12dd5242fab518 (diff) |
Diffstat (limited to 'parse_wiki_text/src')
-rw-r--r-- | parse_wiki_text/src/display.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/parse_wiki_text/src/display.rs b/parse_wiki_text/src/display.rs index 011dd40..1ec87af 100644 --- a/parse_wiki_text/src/display.rs +++ b/parse_wiki_text/src/display.rs @@ -10,11 +10,11 @@ use std::fmt::Error; // why is core::result::Result not usable when i import std::fmt::Result? impl std::fmt::Display for Node<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - return match self { + match self { Node::CharacterEntity { character, .. } => write!(f, "{}", character), Node::Text { value, .. } => write!(f, "{}", value), Node::ParagraphBreak { .. } => write!(f, " "), - Node::HorizontalDivider { .. } => write!(f, "\n------\n"), + Node::HorizontalDivider { .. } => write!(f, "------"), Node::Heading { nodes, level, .. } => { match nodes.get(0) { @@ -42,38 +42,38 @@ impl std::fmt::Display for Node<'_> { Node::OrderedList { items, .. } => { for (i, item) in items.iter().enumerate() { - write!(f, "\n{}. ", i+1)?; + write!(f, "{}. ", i+1)?; for node in &item.nodes { write!(f, "{}", node)? } } - return Ok(()); + Ok(()) }, Node::UnorderedList { items, .. } => { for item in items { - write!(f, "\n• ")?; + write!(f, "• ")?; for node in &item.nodes { write!(f, "{}", node)? } } - return Ok(()); + Ok(()) }, Node::DefinitionList { items, .. } => { for item in items { - write!(f, "\n")?; + write!(f, "")?; for node in &item.nodes { write!(f, "{}", node)? } write!(f, " ")?; } - return Ok(()); + Ok(()) }, Node::ExternalLink { nodes, .. } => { for node in nodes { write!(f, "{}", node)?; } - return Ok(()); + Ok(()) }, // todo: everything below here Node::Image { target, text, .. } => Ok(()), |