From eee2567e8f9e2f8abf736c79ab12dd5242fab518 Mon Sep 17 00:00:00 2001 From: JJ Date: Sat, 17 Jun 2023 19:23:00 -0700 Subject: minor wikitext display cleanups --- parse_wiki_text/src/display.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'parse_wiki_text/src') diff --git a/parse_wiki_text/src/display.rs b/parse_wiki_text/src/display.rs index 4c1f03a..011dd40 100644 --- a/parse_wiki_text/src/display.rs +++ b/parse_wiki_text/src/display.rs @@ -32,7 +32,7 @@ impl std::fmt::Display for Node<'_> { match name.get(0) { Some(name) => if let Node::Text { value, .. } = name { - write!(f, "{}", handle_template(*value, parameters)?) + write!(f, "{}", expand_template(*value, parameters)?) } else { Err(Error) }, @@ -91,7 +91,7 @@ impl std::fmt::Display for Node<'_> { // https://en.wiktionary.org/wiki/Wiktionary:Templates // wow, a function entirely composed of edge cases -fn handle_template(name: &str, parameters: &Vec) -> Result { +fn expand_template(name: &str, parameters: &Vec) -> Result { let mut buffer = String::from(""); match name { "m" => { -- cgit v1.2.3-70-g09d2