diff options
| author | Fuwn <[email protected]> | 2022-06-02 04:04:27 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-06-02 04:04:27 +0000 |
| commit | 96c139a26a94cf0fd4d531df3c07156b3b531568 (patch) | |
| tree | ed2f288d32a8a69947f3a67bfa437021015e5f05 /src/convert/html.rs | |
| parent | docs(cargo): bump version to 0.2.3 (diff) | |
| download | germ-96c139a26a94cf0fd4d531df3c07156b3b531568.tar.xz germ-96c139a26a94cf0fd4d531df3c07156b3b531568.zip | |
feat(germ): ast struct
Diffstat (limited to 'src/convert/html.rs')
| -rw-r--r-- | src/convert/html.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/convert/html.rs b/src/convert/html.rs index 2f031b0..7b1cafe 100644 --- a/src/convert/html.rs +++ b/src/convert/html.rs @@ -18,7 +18,7 @@ use crate::ast::Node; -pub fn convert(source: Vec<Node>) -> String { +pub fn convert(source: &[Node]) -> String { let mut html = String::new(); // Since we have an AST tree of the Gemtext, it is very easy to convert from @@ -33,7 +33,7 @@ pub fn convert(source: Vec<Node>) -> String { html.push_str(&format!( "<a href=\"{}\">{}</a><br>", to, - text.unwrap_or_else(|| to.clone()) + text.clone().unwrap_or_else(|| to.clone()) )); } Node::Heading { @@ -55,7 +55,7 @@ pub fn convert(source: Vec<Node>) -> String { html.push_str(&format!( "<ul>{}</ul>", items - .into_iter() + .iter() .map(|i| format!("<li>{}</li>", i)) .collect::<Vec<String>>() .join("\n") |