Skip to content

Commit ed1646a

Browse files
Rollup merge of #84852 - mautamu:master, r=GuillaumeGomez
Change librustdoc write!(.. \n) to writeln!(..); fix comment grammar Howdy, This PR does the following: 1. Updates the grammar of a comment in librustdoc. 2. Replaces a few write!(..\n) macros with writeln!(..\n) for clarity. (Please let me know if there is a reason why this might be wrong!) Best, Mautamu
2 parents dd5fc8e + 8db7973 commit ed1646a

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/librustdoc/html/highlight.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ crate fn render_with_highlighting(
4646
}
4747

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

5252
fn write_code(out: &mut Buffer, src: &str, edition: Edition) {
@@ -62,7 +62,7 @@ fn write_code(out: &mut Buffer, src: &str, edition: Edition) {
6262
}
6363

6464
fn write_footer(out: &mut Buffer, playground_button: Option<&str>) {
65-
write!(out, "</pre>{}</div>\n", playground_button.unwrap_or_default());
65+
writeln!(out, "</pre>{}</div>", playground_button.unwrap_or_default());
6666
}
6767

6868
/// How a span of text is classified. Mostly corresponds to token kinds.

src/librustdoc/html/render/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ fn attributes(it: &clean::Item) -> Vec<String> {
964964
// a whitespace prefix and newline.
965965
fn render_attributes_in_pre(w: &mut Buffer, it: &clean::Item, prefix: &str) {
966966
for a in attributes(it) {
967-
write!(w, "{}{}\n", prefix, a);
967+
writeln!(w, "{}{}", prefix, a);
968968
}
969969
}
970970

src/librustdoc/html/sources.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ fn print_src(buf: &mut Buffer, s: &str, edition: Edition) {
177177
}
178178
buf.write_str("<pre class=\"line-numbers\">");
179179
for i in 1..=lines {
180-
write!(buf, "<span id=\"{0}\">{0:1$}</span>\n", i, cols);
180+
writeln!(buf, "<span id=\"{0}\">{0:1$}</span>", i, cols);
181181
}
182182
buf.write_str("</pre>");
183183
highlight::render_with_highlighting(s, buf, None, None, None, edition);

src/librustdoc/theme.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ crate struct CssPath {
1717
// This PartialEq implementation IS NOT COMMUTATIVE!!!
1818
//
1919
// The order is very important: the second object must have all first's rules.
20-
// However, the first doesn't require to have all second's rules.
20+
// However, the first is not required to have all of the second's rules.
2121
impl PartialEq for CssPath {
2222
fn eq(&self, other: &CssPath) -> bool {
2323
if self.name != other.name {

0 commit comments

Comments
 (0)