fix: caching inaccuracy
This commit is contained in:
@@ -278,7 +278,9 @@ fn doc_to_impl<'a>(
|
|||||||
out.push_str(&format!("</span>{a}</div>\n"));
|
out.push_str(&format!("</span>{a}</div>\n"));
|
||||||
}
|
}
|
||||||
for section in &doc.sections {
|
for section in &doc.sections {
|
||||||
if let Some(prev) = doc_args.state.cache.get(section) {
|
if doc_args.max_len.is_none()
|
||||||
|
&& let Some(prev) = doc_args.state.cache.get(section)
|
||||||
|
{
|
||||||
out.push_str(prev);
|
out.push_str(prev);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -376,11 +378,13 @@ fn doc_to_impl<'a>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
out.push_str("</div>\n");
|
out.push_str("</div>\n");
|
||||||
|
if doc_args.max_len.is_none() {
|
||||||
doc_args
|
doc_args
|
||||||
.state
|
.state
|
||||||
.cache
|
.cache
|
||||||
.insert(section, out[section_start..].to_owned());
|
.insert(section, out[section_start..].to_owned());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for _ in depth..=doc.depth {
|
for _ in depth..=doc.depth {
|
||||||
out.push_str("</div>\n");
|
out.push_str("</div>\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user