]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/markdown.rs
update Miri
[rust.git] / src / librustdoc / markdown.rs
index a1f92afad46a659bf53b511e640555c901fa2f73..62e42b783e999c97193228a27bbee27d46f9e1b8 100644 (file)
@@ -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 @@ fn extract_leading_metadata(s: &str) -> (Vec<&str>, &str) {
 
     let mut css = String::new();
     for name in &options.markdown_css {
-        let s = format!("<link rel=\"stylesheet\" type=\"text/css\" href=\"{name}\">\n");
-        css.push_str(&s)
+        write!(css, r#"<link rel="stylesheet" type="text/css" href="{name}">"#)
+            .expect("Writing to a String can't fail");
     }
 
     let input_str = read_to_string(input).map_err(|err| format!("{}: {}", input.display(), err))?;