Skip to content

Change librustdoc write!(.. \n) to writeln!(..); fix comment grammar #84852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/librustdoc/html/highlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ crate fn render_with_highlighting(
}

fn write_header(out: &mut Buffer, class: Option<&str>) {
write!(out, "<div class=\"example-wrap\"><pre class=\"rust {}\">\n", class.unwrap_or_default());
writeln!(out, "<div class=\"example-wrap\"><pre class=\"rust {}\">", class.unwrap_or_default());
}

fn write_code(out: &mut Buffer, src: &str, edition: Edition) {
Expand All @@ -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, "</pre>{}</div>\n", playground_button.unwrap_or_default());
writeln!(out, "</pre>{}</div>", playground_button.unwrap_or_default());
}

/// How a span of text is classified. Mostly corresponds to token kinds.
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ fn attributes(it: &clean::Item) -> Vec<String> {
// a whitespace prefix and newline.
fn render_attributes_in_pre(w: &mut Buffer, it: &clean::Item, prefix: &str) {
for a in attributes(it) {
write!(w, "{}{}\n", prefix, a);
writeln!(w, "{}{}", prefix, a);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ fn print_src(buf: &mut Buffer, s: &str, edition: Edition) {
}
buf.write_str("<pre class=\"line-numbers\">");
for i in 1..=lines {
write!(buf, "<span id=\"{0}\">{0:1$}</span>\n", i, cols);
writeln!(buf, "<span id=\"{0}\">{0:1$}</span>", i, cols);
}
buf.write_str("</pre>");
highlight::render_with_highlighting(s, buf, None, None, None, edition);
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down