Skip to content

Commit 8aab3d1

Browse files
committed
Delete writeln_str
1 parent cdb4b66 commit 8aab3d1

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

src/librustdoc/html/format.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ pub(crate) fn write_str(s: &mut String, f: fmt::Arguments<'_>) {
4141
s.write_fmt(f).unwrap();
4242
}
4343

44-
pub(crate) fn writeln_str(s: &mut String, f: fmt::Arguments<'_>) {
45-
s.write_fmt(f).unwrap();
46-
s.push('\n');
47-
}
48-
4944
pub(crate) fn print_generic_bounds<'a, 'tcx: 'a>(
5045
bounds: &'a [clean::GenericBound],
5146
cx: &'a Context<'tcx>,

src/librustdoc/html/highlight.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use rustc_span::edition::Edition;
1414
use rustc_span::symbol::Symbol;
1515
use rustc_span::{BytePos, DUMMY_SP, Span};
1616

17-
use super::format::{self, write_str, writeln_str};
17+
use super::format::{self, write_str};
1818
use crate::clean::PrimitiveType;
1919
use crate::html::escape::EscapeBodyText;
2020
use crate::html::render::{Context, LinkFromSrc};
@@ -331,7 +331,7 @@ pub(super) fn write_code(
331331
}
332332

333333
fn write_footer(out: &mut String, playground_button: Option<&str>) {
334-
writeln_str(out, format_args!("</code></pre>{}</div>", playground_button.unwrap_or_default()));
334+
write_str(out, format_args_nl!("</code></pre>{}</div>", playground_button.unwrap_or_default()));
335335
}
336336

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

src/librustdoc/html/render/print_item.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ use crate::html::escape::{Escape, EscapeBodyTextWithWbr};
3333
use crate::html::format::{
3434
Ending, PrintWithSpace, join_with_double_colon, print_abi_with_space,
3535
print_constness_with_space, print_where_clause, visibility_print_with_space, write_str,
36-
writeln_str,
3736
};
3837
use crate::html::markdown::{HeadingOffset, MarkdownSummaryLine};
3938
use crate::html::render::{document_full, document_item_info};
@@ -755,9 +754,9 @@ fn item_trait(w: &mut String, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
755754
}
756755

757756
if !required_methods.is_empty() {
758-
writeln_str(
757+
write_str(
759758
w,
760-
format_args!(" // Required method{}", pluralize(required_methods.len())),
759+
format_args_nl!(" // Required method{}", pluralize(required_methods.len())),
761760
);
762761
}
763762
for (pos, m) in required_methods.iter().enumerate() {
@@ -780,9 +779,9 @@ fn item_trait(w: &mut String, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
780779
}
781780

782781
if !provided_methods.is_empty() {
783-
writeln_str(
782+
write_str(
784783
w,
785-
format_args!(" // Provided method{}", pluralize(provided_methods.len())),
784+
format_args_nl!(" // Provided method{}", pluralize(provided_methods.len())),
786785
);
787786
}
788787
for (pos, m) in provided_methods.iter().enumerate() {

src/librustdoc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#![feature(box_patterns)]
88
#![feature(debug_closure_helpers)]
99
#![feature(file_buffered)]
10+
#![feature(format_args_nl)]
1011
#![feature(if_let_guard)]
1112
#![feature(impl_trait_in_assoc_type)]
1213
#![feature(iter_intersperse)]

0 commit comments

Comments
 (0)