From d18936a731fa1d2bf49073bd0f059129ef1b0ef1 Mon Sep 17 00:00:00 2001 From: Noah Lev Date: Sat, 21 Aug 2021 17:24:49 -0700 Subject: [PATCH] Use `write!` --- src/librustdoc/html/length_limit.rs | 8 ++------ 1 file 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("'); + 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); }