eliminate needless_late_init

https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
This commit is contained in:
Gabor Szabo 2025-03-04 17:34:08 +02:00
parent d68a596455
commit 0fb814c6d6

View file

@ -107,8 +107,7 @@ impl HelperDef for RenderToc {
}
// Link
let path_exists: bool;
match item.get("path") {
let path_exists = match item.get("path") {
Some(path) if !path.is_empty() => {
out.write("<a href=\"")?;
let tmp = Path::new(path)
@ -125,13 +124,13 @@ impl HelperDef for RenderToc {
} else {
"\">"
})?;
path_exists = true;
true
}
_ => {
out.write("<div>")?;
path_exists = false;
false
}
}
};
if !self.no_section_label {
// Section does not necessarily exist