diff --git a/src/librustdoc/html/highlight.rs b/src/librustdoc/html/highlight.rs index 0030ef67c075d..7130a6bc1e888 100644 --- a/src/librustdoc/html/highlight.rs +++ b/src/librustdoc/html/highlight.rs @@ -46,7 +46,7 @@ crate fn render_with_highlighting( } fn write_header(out: &mut Buffer, class: Option<&str>) { - write!(out, "
\n", class.unwrap_or_default()); + writeln!(out, "{}\n", playground_button.unwrap_or_default()); + writeln!(out, "", class.unwrap_or_default()); } fn write_code(out: &mut Buffer, src: &str, edition: Edition) { @@ -62,7 +62,7 @@ fn write_code(out: &mut Buffer, src: &str, edition: Edition) { } fn write_footer(out: &mut Buffer, playground_button: Option<&str>) { - write!(out, "{}
");
for i in 1..=lines {
- write!(buf, "{0:1$}\n", i, cols);
+ writeln!(buf, "{0:1$}", i, cols);
}
buf.write_str("");
highlight::render_with_highlighting(s, buf, None, None, None, edition);
diff --git a/src/librustdoc/theme.rs b/src/librustdoc/theme.rs
index 24d5770541273..b8b3f9634e582 100644
--- a/src/librustdoc/theme.rs
+++ b/src/librustdoc/theme.rs
@@ -17,7 +17,7 @@ crate struct CssPath {
// This PartialEq implementation IS NOT COMMUTATIVE!!!
//
// The order is very important: the second object must have all first's rules.
-// However, the first doesn't require to have all second's rules.
+// However, the first is not required to have all of the second's rules.
impl PartialEq for CssPath {
fn eq(&self, other: &CssPath) -> bool {
if self.name != other.name {