Skip to content

Commit d18936a

Browse files
committed
Use write!
1 parent 74147b8 commit d18936a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/librustdoc/html/length_limit.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,13 @@ impl HtmlWithLimit {
7979
/// Close the most recently opened HTML tag.
8080
pub(super) fn close_tag(&mut self) {
8181
let tag_name = self.unclosed_tags.pop().unwrap();
82-
self.buf.push_str("</");
83-
self.buf.push_str(tag_name);
84-
self.buf.push('>');
82+
write!(self.buf, "</{}>", tag_name).unwrap();
8583
}
8684

8785
/// Write all queued tags and add them to the `unclosed_tags` list.
8886
fn flush_queue(&mut self) {
8987
for tag_name in self.queued_tags.drain(..) {
90-
self.buf.push('<');
91-
self.buf.push_str(tag_name);
92-
self.buf.push('>');
88+
write!(self.buf, "<{}>", tag_name).unwrap();
9389

9490
self.unclosed_tags.push(tag_name);
9591
}

0 commit comments

Comments
 (0)