Merge pull request #2568 from szabgab/remove-needless-late-init

[refactor] eliminate needless_late_init
This commit is contained in:
Eric Huss 2025-04-19 13:12:39 +00:00 committed by GitHub
commit 3e6b42cfba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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