* useless compileoption

* use any instead of fold
This commit is contained in:
Mylloon 2023-04-11 00:57:59 +02:00
parent d4ff53cee8
commit ff7fa90cdc
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -60,8 +60,6 @@ pub fn read_md(filename: &str) -> (Metadata, String) {
let compile_option = markdown::CompileOptions {
allow_dangerous_html: true,
gfm_footnote_label: Some("Notes de bas de page".into()),
gfm_footnote_back_label: Some("Arrière".into()),
..markdown::CompileOptions::gfm()
};
@ -85,15 +83,9 @@ pub fn read_md(filename: &str) -> (Metadata, String) {
.unwrap();
// Find if document contains mermaid diagram
let presence_mermaid = md_nodes.iter().fold(false, |acc, x| {
if !acc {
match x {
markdown::mdast::Node::Code(code) => code.lang == Some(String::from("mermaid")),
_ => false,
}
} else {
false
}
let presence_mermaid = md_nodes.iter().any(|x| match x {
markdown::mdast::Node::Code(code) => code.lang == Some(String::from("mermaid")),
_ => false,
});
(