diff options
| -rw-r--r-- | src/librustdoc/html/length_limit.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/librustdoc/html/length_limit.rs b/src/librustdoc/html/length_limit.rs index cc4a7f37fe9..2b47033744f 100644 --- a/src/librustdoc/html/length_limit.rs +++ b/src/librustdoc/html/length_limit.rs @@ -79,17 +79,13 @@ impl HtmlWithLimit { /// Close the most recently opened HTML tag. pub(super) fn close_tag(&mut self) { let tag_name = self.unclosed_tags.pop().unwrap(); - self.buf.push_str("</"); - self.buf.push_str(tag_name); - self.buf.push('>'); + write!(self.buf, "</{}>", tag_name).unwrap(); } /// Write all queued tags and add them to the `unclosed_tags` list. fn flush_queue(&mut self) { for tag_name in self.queued_tags.drain(..) { - self.buf.push('<'); - self.buf.push_str(tag_name); - self.buf.push('>'); + write!(self.buf, "<{}>", tag_name).unwrap(); self.unclosed_tags.push(tag_name); } |
