Skip to content

Commit 8db7973

Browse files
committed
Change librustdoc write(.. \n) to writeln(..); fix comment in grammar
More grammar
1 parent 59f551a commit 8db7973

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/librustdoc/html/highlight.rs

+2-2
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

+1-1
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

+1-1
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

+1-1
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)