eliminate needless_late_init
https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
This commit is contained in:
parent
d68a596455
commit
0fb814c6d6
1 changed files with 4 additions and 5 deletions
|
|
@ -107,8 +107,7 @@ impl HelperDef for RenderToc {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Link
|
// Link
|
||||||
let path_exists: bool;
|
let path_exists = match item.get("path") {
|
||||||
match item.get("path") {
|
|
||||||
Some(path) if !path.is_empty() => {
|
Some(path) if !path.is_empty() => {
|
||||||
out.write("<a href=\"")?;
|
out.write("<a href=\"")?;
|
||||||
let tmp = Path::new(path)
|
let tmp = Path::new(path)
|
||||||
|
|
@ -125,13 +124,13 @@ impl HelperDef for RenderToc {
|
||||||
} else {
|
} else {
|
||||||
"\">"
|
"\">"
|
||||||
})?;
|
})?;
|
||||||
path_exists = true;
|
true
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
out.write("<div>")?;
|
out.write("<div>")?;
|
||||||
path_exists = false;
|
false
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
if !self.no_section_label {
|
if !self.no_section_label {
|
||||||
// Section does not necessarily exist
|
// Section does not necessarily exist
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue