clippy
This commit is contained in:
parent
1c9d234430
commit
730b9aa4f8
|
@ -12,7 +12,7 @@ socket.addEventListener("message", (event) => {
|
||||||
pub(crate) fn render_head<'s, 'r>(
|
pub(crate) fn render_head<'s, 'r>(
|
||||||
sack: &'s Sack,
|
sack: &'s Sack,
|
||||||
title: String,
|
title: String,
|
||||||
styles: &'s [&str],
|
_styles: &'s [&str],
|
||||||
scripts: Option<&'s [String]>,
|
scripts: Option<&'s [String]>,
|
||||||
) -> Result<impl Renderable + 'r, String>
|
) -> Result<impl Renderable + 'r, String>
|
||||||
where
|
where
|
||||||
|
@ -63,7 +63,10 @@ fn render_style(style: &HashedStyle) -> impl Renderable + '_ {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn emit_tags_script<'a>(sack: &'a Sack, scripts: &'a [String]) -> Result<impl Renderable + 'a, String> {
|
fn emit_tags_script<'a>(
|
||||||
|
sack: &'a Sack,
|
||||||
|
scripts: &'a [String],
|
||||||
|
) -> Result<impl Renderable + 'a, String> {
|
||||||
let tags = scripts
|
let tags = scripts
|
||||||
.iter()
|
.iter()
|
||||||
.map(|script| emit_tag_script(sack, script))
|
.map(|script| emit_tag_script(sack, script))
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
use std::fmt::Write;
|
||||||
|
|
||||||
use camino::Utf8Path;
|
use camino::Utf8Path;
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
use hauchiwa::{Bibliography, Outline, Sack};
|
use hauchiwa::{Bibliography, Outline, Sack};
|
||||||
|
@ -37,13 +39,15 @@ pub fn parse_content(
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
})
|
})
|
||||||
.map(|stack| match stack.len() > 1 {
|
.map(|stack| match stack.len() > 1 {
|
||||||
true => format!(
|
true => {
|
||||||
"<section>{}</section>",
|
let mut buffer = String::from("<section>");
|
||||||
stack
|
|
||||||
.into_iter()
|
for slide in stack {
|
||||||
.map(|slide| format!("<section>{slide}</section>"))
|
write!(buffer, "<section>{}</section>", slide).unwrap();
|
||||||
.collect::<String>()
|
}
|
||||||
),
|
|
||||||
|
buffer
|
||||||
|
}
|
||||||
false => format!("<section>{}</section>", stack[0]),
|
false => format!("<section>{}</section>", stack[0]),
|
||||||
})
|
})
|
||||||
.collect::<String>();
|
.collect::<String>();
|
||||||
|
|
Loading…
Reference in a new issue