Skip to content

Commit c9a48d1

Browse files
committedAug 31, 2020
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

‎src/librustdoc/html/render/mod.rs

+78-91
Large diffs are not rendered by default.

‎src/librustdoc/html/sources.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl<'a> DocFolder for SourceCollector<'a> {
5252
Err(e) => {
5353
println!(
5454
"warning: source code was requested to be rendered, \
55-
but processing `{}` had an error: {}",
55+
but processing `{}` had an error: {}",
5656
item.source.filename, e
5757
);
5858
println!(" skipping rendering of source code");

‎src/librustdoc/lib.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ fn opts() -> Vec<RustcOptGroup> {
153153
"",
154154
"passes",
155155
"list of passes to also run, you might want to pass it multiple times; a value of \
156-
`list` will print available passes",
156+
`list` will print available passes",
157157
"PASSES",
158158
)
159159
}),
@@ -183,7 +183,7 @@ fn opts() -> Vec<RustcOptGroup> {
183183
"",
184184
"html-in-header",
185185
"files to include inline in the <head> section of a rendered Markdown file \
186-
or generated documentation",
186+
or generated documentation",
187187
"FILES",
188188
)
189189
}),
@@ -192,7 +192,7 @@ fn opts() -> Vec<RustcOptGroup> {
192192
"",
193193
"html-before-content",
194194
"files to include inline between <body> and the content of a rendered \
195-
Markdown file or generated documentation",
195+
Markdown file or generated documentation",
196196
"FILES",
197197
)
198198
}),
@@ -201,7 +201,7 @@ fn opts() -> Vec<RustcOptGroup> {
201201
"",
202202
"html-after-content",
203203
"files to include inline between the content and </body> of a rendered \
204-
Markdown file or generated documentation",
204+
Markdown file or generated documentation",
205205
"FILES",
206206
)
207207
}),
@@ -210,7 +210,7 @@ fn opts() -> Vec<RustcOptGroup> {
210210
"",
211211
"markdown-before-content",
212212
"files to include inline between <body> and the content of a rendered \
213-
Markdown file or generated documentation",
213+
Markdown file or generated documentation",
214214
"FILES",
215215
)
216216
}),
@@ -219,7 +219,7 @@ fn opts() -> Vec<RustcOptGroup> {
219219
"",
220220
"markdown-after-content",
221221
"files to include inline between the content and </body> of a rendered \
222-
Markdown file or generated documentation",
222+
Markdown file or generated documentation",
223223
"FILES",
224224
)
225225
}),
@@ -234,8 +234,8 @@ fn opts() -> Vec<RustcOptGroup> {
234234
"e",
235235
"extend-css",
236236
"To add some CSS rules with a given file to generate doc with your \
237-
own theme. However, your theme might break if the rustdoc's generated HTML \
238-
changes, so be careful!",
237+
own theme. However, your theme might break if the rustdoc's generated HTML \
238+
changes, so be careful!",
239239
"PATH",
240240
)
241241
}),
@@ -248,7 +248,7 @@ fn opts() -> Vec<RustcOptGroup> {
248248
"",
249249
"playground-url",
250250
"URL to send code snippets to, may be reset by --markdown-playground-url \
251-
or `#![doc(html_playground_url=...)]`",
251+
or `#![doc(html_playground_url=...)]`",
252252
"URL",
253253
)
254254
}),
@@ -281,7 +281,7 @@ fn opts() -> Vec<RustcOptGroup> {
281281
"",
282282
"resource-suffix",
283283
"suffix to add to CSS and JavaScript files, e.g., \"light.css\" will become \
284-
\"light-suffix.css\"",
284+
\"light-suffix.css\"",
285285
"PATH",
286286
)
287287
}),
@@ -343,7 +343,7 @@ fn opts() -> Vec<RustcOptGroup> {
343343
"",
344344
"static-root-path",
345345
"Path string to force loading static files from in output pages. \
346-
If not set, uses combinations of '../' to reach the documentation root.",
346+
If not set, uses combinations of '../' to reach the documentation root.",
347347
"PATH",
348348
)
349349
}),

‎src/librustdoc/passes/collect_intra_doc_links.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ fn report_diagnostic(
11571157
// Print the line containing the `link_range` and manually mark it with '^'s.
11581158
diag.note(&format!(
11591159
"the link appears in this line:\n\n{line}\n\
1160-
{indicator: <before$}{indicator:^<found$}",
1160+
{indicator: <before$}{indicator:^<found$}",
11611161
line = line,
11621162
indicator = "",
11631163
before = link_range.start - last_new_line_offset,

‎src/librustdoc/passes/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,7 @@ impl<'a> DocFolder for ImplStripper<'a> {
284284
if let Some(did) = typaram.def_id() {
285285
if did.is_local() && !self.retained.contains(&did) {
286286
debug!(
287-
"ImplStripper: stripped item in trait's generics; \
288-
removing impl"
287+
"ImplStripper: stripped item in trait's generics; removing impl"
289288
);
290289
return None;
291290
}

‎src/librustdoc/passes/strip_private.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub const STRIP_PRIVATE: Pass = Pass {
99
name: "strip-private",
1010
run: strip_private,
1111
description: "strips all private items from a crate which cannot be seen externally, \
12-
implies strip-priv-imports",
12+
implies strip-priv-imports",
1313
};
1414

1515
/// Strip private items from the point of view of a crate or externally from a

0 commit comments

Comments
 (0)
Please sign in to comment.