We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c57a8fc + 0fb814c commit 3e6b42cCopy full SHA for 3e6b42c
src/renderer/html_handlebars/helpers/toc.rs
@@ -107,8 +107,7 @@ impl HelperDef for RenderToc {
107
}
108
109
// Link
110
- let path_exists: bool;
111
- match item.get("path") {
+ let path_exists = match item.get("path") {
112
Some(path) if !path.is_empty() => {
113
out.write("<a href=\"")?;
114
let tmp = Path::new(path)
@@ -125,13 +124,13 @@ impl HelperDef for RenderToc {
125
124
} else {
126
"\">"
127
})?;
128
- path_exists = true;
+ true
129
130
_ => {
131
out.write("<div>")?;
132
- path_exists = false;
+ false
133
134
- }
+ };
135
136
if !self.no_section_label {
137
// Section does not necessarily exist
0 commit comments