From ab3ab4de0b0e39f64737c9414213fd66e638cf78 Mon Sep 17 00:00:00 2001 From: Roc Yu Date: Tue, 12 Apr 2022 11:04:37 -0400 Subject: [PATCH] Remove a `format` invocation --- src/librustdoc/markdown.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/markdown.rs b/src/librustdoc/markdown.rs index a1f92afad46a6..62e42b783e999 100644 --- a/src/librustdoc/markdown.rs +++ b/src/librustdoc/markdown.rs @@ -1,3 +1,4 @@ +use std::fmt::Write as _; use std::fs::{create_dir_all, read_to_string, File}; use std::io::prelude::*; use std::path::Path; @@ -51,8 +52,8 @@ crate fn render>( let mut css = String::new(); for name in &options.markdown_css { - let s = format!("\n"); - css.push_str(&s) + write!(css, r#""#) + .expect("Writing to a String can't fail"); } let input_str = read_to_string(input).map_err(|err| format!("{}: {}", input.display(), err))?;