less symbols interner locks
This commit is contained in:
parent
9ce37dc729
commit
7ea4f35766
@ -167,12 +167,13 @@ pub fn unindent_doc_fragments(docs: &mut [DocFragment]) {
|
|||||||
///
|
///
|
||||||
/// Note: remove the trailing newline where appropriate
|
/// Note: remove the trailing newline where appropriate
|
||||||
pub fn add_doc_fragment(out: &mut String, frag: &DocFragment) {
|
pub fn add_doc_fragment(out: &mut String, frag: &DocFragment) {
|
||||||
let s = frag.doc.as_str();
|
if frag.doc == kw::Empty {
|
||||||
let mut iter = s.lines();
|
|
||||||
if s.is_empty() {
|
|
||||||
out.push('\n');
|
out.push('\n');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
let s = frag.doc.as_str();
|
||||||
|
let mut iter = s.lines();
|
||||||
|
|
||||||
while let Some(line) = iter.next() {
|
while let Some(line) = iter.next() {
|
||||||
if line.chars().any(|c| !c.is_whitespace()) {
|
if line.chars().any(|c| !c.is_whitespace()) {
|
||||||
assert!(line.len() >= frag.indent);
|
assert!(line.len() >= frag.indent);
|
||||||
|
@ -1698,9 +1698,10 @@ fn render_impl(
|
|||||||
let id = cx.derive_id(format!("{item_type}.{name}"));
|
let id = cx.derive_id(format!("{item_type}.{name}"));
|
||||||
let source_id = trait_
|
let source_id = trait_
|
||||||
.and_then(|trait_| {
|
.and_then(|trait_| {
|
||||||
trait_.items.iter().find(|item| {
|
trait_
|
||||||
item.name.map(|n| n.as_str().eq(name.as_str())).unwrap_or(false)
|
.items
|
||||||
})
|
.iter()
|
||||||
|
.find(|item| item.name.map(|n| n == *name).unwrap_or(false))
|
||||||
})
|
})
|
||||||
.map(|item| format!("{}.{name}", item.type_()));
|
.map(|item| format!("{}.{name}", item.type_()));
|
||||||
write!(w, "<section id=\"{id}\" class=\"{item_type}{in_trait_class}\">");
|
write!(w, "<section id=\"{id}\" class=\"{item_type}{in_trait_class}\">");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user