Skip to content

Commit c9a48d1

Browse files
Fix strings indent
1 parent 6c44bcc commit c9a48d1

16 files changed

+127
-153
lines changed

src/librustdoc/clean/blanket_impl.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
7575
}
7676
});
7777
debug!(
78-
"get_blanket_impls: found applicable impl: {}\
79-
for trait_ref={:?}, ty={:?}",
78+
"get_blanket_impls: found applicable impl: {} for trait_ref={:?}, ty={:?}",
8079
may_apply, trait_ref, ty
8180
);
8281
if !may_apply {

src/librustdoc/clean/cfg/tests.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -391,26 +391,25 @@ fn test_render_long_html() {
391391
(word_cfg("unix") & word_cfg("windows") & word_cfg("debug_assertions"))
392392
.render_long_html(),
393393
"This is supported on <strong>Unix and Windows and debug-assertions enabled\
394-
</strong> only."
394+
</strong> only."
395395
);
396396
assert_eq!(
397397
(word_cfg("unix") | word_cfg("windows") | word_cfg("debug_assertions"))
398398
.render_long_html(),
399399
"This is supported on <strong>Unix or Windows or debug-assertions enabled\
400-
</strong> only."
400+
</strong> only."
401401
);
402402
assert_eq!(
403403
(!(word_cfg("unix") | word_cfg("windows") | word_cfg("debug_assertions")))
404404
.render_long_html(),
405405
"This is supported on <strong>neither Unix nor Windows nor debug-assertions \
406-
enabled</strong>."
406+
enabled</strong>."
407407
);
408408
assert_eq!(
409409
((word_cfg("unix") & name_value_cfg("target_arch", "x86_64"))
410410
| (word_cfg("windows") & name_value_cfg("target_pointer_width", "64")))
411411
.render_long_html(),
412-
"This is supported on <strong>Unix and x86-64, or Windows and 64-bit</strong> \
413-
only."
412+
"This is supported on <strong>Unix and x86-64, or Windows and 64-bit</strong> only."
414413
);
415414
assert_eq!(
416415
(!(word_cfg("unix") & word_cfg("windows"))).render_long_html(),
@@ -420,7 +419,7 @@ fn test_render_long_html() {
420419
((word_cfg("debug_assertions") | word_cfg("windows")) & word_cfg("unix"))
421420
.render_long_html(),
422421
"This is supported on <strong>(debug-assertions enabled or Windows) and Unix\
423-
</strong> only."
422+
</strong> only."
424423
);
425424
assert_eq!(
426425
name_value_cfg("target_feature", "sse2").render_long_html(),
@@ -430,7 +429,7 @@ fn test_render_long_html() {
430429
(name_value_cfg("target_arch", "x86_64") & name_value_cfg("target_feature", "sse2"))
431430
.render_long_html(),
432431
"This is supported on <strong>x86-64 and target feature \
433-
<code>sse2</code></strong> only."
432+
<code>sse2</code></strong> only."
434433
);
435434
})
436435
}

src/librustdoc/clean/utils.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -422,14 +422,13 @@ pub fn name_from_pat(p: &hir::Pat<'_>) -> String {
422422
PatKind::Ref(ref p, _) => name_from_pat(&**p),
423423
PatKind::Lit(..) => {
424424
warn!(
425-
"tried to get argument name from PatKind::Lit, \
426-
which is silly in function arguments"
425+
"tried to get argument name from PatKind::Lit, which is silly in function arguments"
427426
);
428427
"()".to_string()
429428
}
430429
PatKind::Range(..) => panic!(
431430
"tried to get argument name from PatKind::Range, \
432-
which is not allowed in function arguments"
431+
which is not allowed in function arguments"
433432
),
434433
PatKind::Slice(ref begin, ref mid, ref end) => {
435434
let begin = begin.iter().map(|p| name_from_pat(&**p));

src/librustdoc/config.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -416,14 +416,12 @@ impl Options {
416416
return Err(1);
417417
} else if !ret.is_empty() {
418418
diag.struct_warn(&format!(
419-
"theme file \"{}\" is missing CSS rules from the \
420-
default theme",
419+
"theme file \"{}\" is missing CSS rules from the default theme",
421420
theme_s
422421
))
423422
.warn("the theme may appear incorrect when loaded")
424423
.help(&format!(
425-
"to see what rules are missing, call `rustdoc \
426-
--check-theme \"{}\"`",
424+
"to see what rules are missing, call `rustdoc --check-theme \"{}\"`",
427425
theme_s
428426
))
429427
.emit();

src/librustdoc/core.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,7 @@ fn run_global_ctxt(
561561
if let Some(ref m) = krate.module {
562562
if let None | Some("") = m.doc_value() {
563563
let help = "The following guide may be of use:\n\
564-
https://doc.rust-lang.org/nightly/rustdoc/how-to-write-documentation\
565-
.html";
564+
https://doc.rust-lang.org/nightly/rustdoc/how-to-write-documentation.html";
566565
tcx.struct_lint_node(
567566
rustc_lint::builtin::MISSING_CRATE_LEVEL_DOCS,
568567
ctxt.as_local_hir_id(m.def_id).unwrap(),
@@ -581,7 +580,7 @@ fn run_global_ctxt(
581580
.struct_warn(&format!("the `#![doc({})]` attribute is considered deprecated", name));
582581
msg.warn(
583582
"see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
584-
for more information",
583+
for more information",
585584
);
586585

587586
if name == "no_default_passes" {
@@ -614,7 +613,7 @@ fn run_global_ctxt(
614613
report_deprecated_attr("plugins = \"...\"", diag);
615614
eprintln!(
616615
"WARNING: `#![doc(plugins = \"...\")]` \
617-
no longer functions; see CVE-2018-1000622"
616+
no longer functions; see CVE-2018-1000622"
618617
);
619618
continue;
620619
}

src/librustdoc/html/format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ fn fmt_type(t: &clean::Type, f: &mut fmt::Formatter<'_>, use_absolute: bool) ->
833833
write!(
834834
f,
835835
"<a class=\"type\" href=\"{url}#{shortty}.{name}\" \
836-
title=\"type {path}::{name}\">{name}</a>",
836+
title=\"type {path}::{name}\">{name}</a>",
837837
url = url,
838838
shortty = ItemType::AssocType,
839839
name = name,

src/librustdoc/html/highlight.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub fn render_with_highlighting(
2727
write!(
2828
out,
2929
"<div class='information'><div class='tooltip {}'>ⓘ<span \
30-
class='tooltiptext'>{}</span></div></div>",
30+
class='tooltiptext'>{}</span></div></div>",
3131
class, tooltip
3232
)
3333
.unwrap();

src/librustdoc/html/layout.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ pub fn render<T: Print, S: Print>(
210210
.collect::<String>(),
211211
filter_crates = if layout.generate_search_filter {
212212
"<select id=\"crate-search\">\
213-
<option value=\"All crates\">All crates</option>\
214-
</select>"
213+
<option value=\"All crates\">All crates</option>\
214+
</select>"
215215
} else {
216216
""
217217
},

src/librustdoc/html/markdown.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for Footnotes<'a, I> {
519519
Some(Event::FootnoteReference(ref reference)) => {
520520
let entry = self.get_entry(&reference);
521521
let reference = format!(
522-
"<sup id=\"fnref{0}\"><a href=\"#fn{0}\">{0}\
523-
</a></sup>",
522+
"<sup id=\"fnref{0}\"><a href=\"#fn{0}\">{0}</a></sup>",
524523
(*entry).1
525524
);
526525
return Some(Event::Html(reference.into()));

src/librustdoc/html/markdown/tests.rs

+15-20
Original file line numberDiff line numberDiff line change
@@ -140,25 +140,26 @@ fn test_header() {
140140

141141
t(
142142
"# Foo bar",
143-
"<h1 id=\"foo-bar\" class=\"section-header\">\
144-
<a href=\"#foo-bar\">Foo bar</a></h1>",
143+
"<h1 id=\"foo-bar\" class=\"section-header\"><a href=\"#foo-bar\">Foo bar</a></h1>",
145144
);
146145
t(
147146
"## Foo-bar_baz qux",
148-
"<h2 id=\"foo-bar_baz-qux\" class=\"section-\
149-
header\"><a href=\"#foo-bar_baz-qux\">Foo-bar_baz qux</a></h2>",
147+
"<h2 id=\"foo-bar_baz-qux\" class=\"section-header\">
148+
<a href=\"#foo-bar_baz-qux\">Foo-bar_baz qux</a></h2>",
150149
);
151150
t(
152151
"### **Foo** *bar* baz!?!& -_qux_-%",
153152
"<h3 id=\"foo-bar-baz--qux-\" class=\"section-header\">\
154-
<a href=\"#foo-bar-baz--qux-\"><strong>Foo</strong> \
155-
<em>bar</em> baz!?!&amp; -<em>qux</em>-%</a></h3>",
153+
<a href=\"#foo-bar-baz--qux-\"><strong>Foo</strong> \
154+
<em>bar</em> baz!?!&amp; -<em>qux</em>-%</a>\
155+
</h3>",
156156
);
157157
t(
158158
"#### **Foo?** & \\*bar?!* _`baz`_ ❤ #qux",
159159
"<h4 id=\"foo--bar--baz--qux\" class=\"section-header\">\
160-
<a href=\"#foo--bar--baz--qux\"><strong>Foo?</strong> &amp; *bar?!* \
161-
<em><code>baz</code></em> ❤ #qux</a></h4>",
160+
<a href=\"#foo--bar--baz--qux\"><strong>Foo?</strong> &amp; *bar?!* \
161+
<em><code>baz</code></em> ❤ #qux</a>\
162+
</h4>",
162163
);
163164
}
164165

@@ -174,38 +175,32 @@ fn test_header_ids_multiple_blocks() {
174175
t(
175176
&mut map,
176177
"# Example",
177-
"<h1 id=\"example\" class=\"section-header\">\
178-
<a href=\"#example\">Example</a></h1>",
178+
"<h1 id=\"example\" class=\"section-header\"><a href=\"#example\">Example</a></h1>",
179179
);
180180
t(
181181
&mut map,
182182
"# Panics",
183-
"<h1 id=\"panics\" class=\"section-header\">\
184-
<a href=\"#panics\">Panics</a></h1>",
183+
"<h1 id=\"panics\" class=\"section-header\"><a href=\"#panics\">Panics</a></h1>",
185184
);
186185
t(
187186
&mut map,
188187
"# Example",
189-
"<h1 id=\"example-1\" class=\"section-header\">\
190-
<a href=\"#example-1\">Example</a></h1>",
188+
"<h1 id=\"example-1\" class=\"section-header\"><a href=\"#example-1\">Example</a></h1>",
191189
);
192190
t(
193191
&mut map,
194192
"# Main",
195-
"<h1 id=\"main-1\" class=\"section-header\">\
196-
<a href=\"#main-1\">Main</a></h1>",
193+
"<h1 id=\"main-1\" class=\"section-header\"><a href=\"#main-1\">Main</a></h1>",
197194
);
198195
t(
199196
&mut map,
200197
"# Example",
201-
"<h1 id=\"example-2\" class=\"section-header\">\
202-
<a href=\"#example-2\">Example</a></h1>",
198+
"<h1 id=\"example-2\" class=\"section-header\"><a href=\"#example-2\">Example</a></h1>",
203199
);
204200
t(
205201
&mut map,
206202
"# Panics",
207-
"<h1 id=\"panics-1\" class=\"section-header\">\
208-
<a href=\"#panics-1\">Panics</a></h1>",
203+
"<h1 id=\"panics-1\" class=\"section-header\"><a href=\"#panics-1\">Panics</a></h1>",
209204
);
210205
}
211206

0 commit comments

Comments
 (0)