Fix strings indent
This commit is contained in:
parent
6c44bcc4ff
commit
c9a48d1d73
16 changed files with 127 additions and 153 deletions
|
@ -75,8 +75,7 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
|
|||
}
|
||||
});
|
||||
debug!(
|
||||
"get_blanket_impls: found applicable impl: {}\
|
||||
for trait_ref={:?}, ty={:?}",
|
||||
"get_blanket_impls: found applicable impl: {} for trait_ref={:?}, ty={:?}",
|
||||
may_apply, trait_ref, ty
|
||||
);
|
||||
if !may_apply {
|
||||
|
|
|
@ -409,8 +409,7 @@ fn test_render_long_html() {
|
|||
((word_cfg("unix") & name_value_cfg("target_arch", "x86_64"))
|
||||
| (word_cfg("windows") & name_value_cfg("target_pointer_width", "64")))
|
||||
.render_long_html(),
|
||||
"This is supported on <strong>Unix and x86-64, or Windows and 64-bit</strong> \
|
||||
only."
|
||||
"This is supported on <strong>Unix and x86-64, or Windows and 64-bit</strong> only."
|
||||
);
|
||||
assert_eq!(
|
||||
(!(word_cfg("unix") & word_cfg("windows"))).render_long_html(),
|
||||
|
|
|
@ -422,8 +422,7 @@ pub fn name_from_pat(p: &hir::Pat<'_>) -> String {
|
|||
PatKind::Ref(ref p, _) => name_from_pat(&**p),
|
||||
PatKind::Lit(..) => {
|
||||
warn!(
|
||||
"tried to get argument name from PatKind::Lit, \
|
||||
which is silly in function arguments"
|
||||
"tried to get argument name from PatKind::Lit, which is silly in function arguments"
|
||||
);
|
||||
"()".to_string()
|
||||
}
|
||||
|
|
|
@ -416,14 +416,12 @@ impl Options {
|
|||
return Err(1);
|
||||
} else if !ret.is_empty() {
|
||||
diag.struct_warn(&format!(
|
||||
"theme file \"{}\" is missing CSS rules from the \
|
||||
default theme",
|
||||
"theme file \"{}\" is missing CSS rules from the default theme",
|
||||
theme_s
|
||||
))
|
||||
.warn("the theme may appear incorrect when loaded")
|
||||
.help(&format!(
|
||||
"to see what rules are missing, call `rustdoc \
|
||||
--check-theme \"{}\"`",
|
||||
"to see what rules are missing, call `rustdoc --check-theme \"{}\"`",
|
||||
theme_s
|
||||
))
|
||||
.emit();
|
||||
|
|
|
@ -561,8 +561,7 @@ fn run_global_ctxt(
|
|||
if let Some(ref m) = krate.module {
|
||||
if let None | Some("") = m.doc_value() {
|
||||
let help = "The following guide may be of use:\n\
|
||||
https://doc.rust-lang.org/nightly/rustdoc/how-to-write-documentation\
|
||||
.html";
|
||||
https://doc.rust-lang.org/nightly/rustdoc/how-to-write-documentation.html";
|
||||
tcx.struct_lint_node(
|
||||
rustc_lint::builtin::MISSING_CRATE_LEVEL_DOCS,
|
||||
ctxt.as_local_hir_id(m.def_id).unwrap(),
|
||||
|
|
|
@ -519,8 +519,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for Footnotes<'a, I> {
|
|||
Some(Event::FootnoteReference(ref reference)) => {
|
||||
let entry = self.get_entry(&reference);
|
||||
let reference = format!(
|
||||
"<sup id=\"fnref{0}\"><a href=\"#fn{0}\">{0}\
|
||||
</a></sup>",
|
||||
"<sup id=\"fnref{0}\"><a href=\"#fn{0}\">{0}</a></sup>",
|
||||
(*entry).1
|
||||
);
|
||||
return Some(Event::Html(reference.into()));
|
||||
|
|
|
@ -140,25 +140,26 @@ fn test_header() {
|
|||
|
||||
t(
|
||||
"# Foo bar",
|
||||
"<h1 id=\"foo-bar\" class=\"section-header\">\
|
||||
<a href=\"#foo-bar\">Foo bar</a></h1>",
|
||||
"<h1 id=\"foo-bar\" class=\"section-header\"><a href=\"#foo-bar\">Foo bar</a></h1>",
|
||||
);
|
||||
t(
|
||||
"## Foo-bar_baz qux",
|
||||
"<h2 id=\"foo-bar_baz-qux\" class=\"section-\
|
||||
header\"><a href=\"#foo-bar_baz-qux\">Foo-bar_baz qux</a></h2>",
|
||||
"<h2 id=\"foo-bar_baz-qux\" class=\"section-header\">
|
||||
<a href=\"#foo-bar_baz-qux\">Foo-bar_baz qux</a></h2>",
|
||||
);
|
||||
t(
|
||||
"### **Foo** *bar* baz!?!& -_qux_-%",
|
||||
"<h3 id=\"foo-bar-baz--qux-\" class=\"section-header\">\
|
||||
<a href=\"#foo-bar-baz--qux-\"><strong>Foo</strong> \
|
||||
<em>bar</em> baz!?!& -<em>qux</em>-%</a></h3>",
|
||||
<em>bar</em> baz!?!& -<em>qux</em>-%</a>\
|
||||
</h3>",
|
||||
);
|
||||
t(
|
||||
"#### **Foo?** & \\*bar?!* _`baz`_ ❤ #qux",
|
||||
"<h4 id=\"foo--bar--baz--qux\" class=\"section-header\">\
|
||||
<a href=\"#foo--bar--baz--qux\"><strong>Foo?</strong> & *bar?!* \
|
||||
<em><code>baz</code></em> ❤ #qux</a></h4>",
|
||||
<em><code>baz</code></em> ❤ #qux</a>\
|
||||
</h4>",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -174,38 +175,32 @@ fn test_header_ids_multiple_blocks() {
|
|||
t(
|
||||
&mut map,
|
||||
"# Example",
|
||||
"<h1 id=\"example\" class=\"section-header\">\
|
||||
<a href=\"#example\">Example</a></h1>",
|
||||
"<h1 id=\"example\" class=\"section-header\"><a href=\"#example\">Example</a></h1>",
|
||||
);
|
||||
t(
|
||||
&mut map,
|
||||
"# Panics",
|
||||
"<h1 id=\"panics\" class=\"section-header\">\
|
||||
<a href=\"#panics\">Panics</a></h1>",
|
||||
"<h1 id=\"panics\" class=\"section-header\"><a href=\"#panics\">Panics</a></h1>",
|
||||
);
|
||||
t(
|
||||
&mut map,
|
||||
"# Example",
|
||||
"<h1 id=\"example-1\" class=\"section-header\">\
|
||||
<a href=\"#example-1\">Example</a></h1>",
|
||||
"<h1 id=\"example-1\" class=\"section-header\"><a href=\"#example-1\">Example</a></h1>",
|
||||
);
|
||||
t(
|
||||
&mut map,
|
||||
"# Main",
|
||||
"<h1 id=\"main-1\" class=\"section-header\">\
|
||||
<a href=\"#main-1\">Main</a></h1>",
|
||||
"<h1 id=\"main-1\" class=\"section-header\"><a href=\"#main-1\">Main</a></h1>",
|
||||
);
|
||||
t(
|
||||
&mut map,
|
||||
"# Example",
|
||||
"<h1 id=\"example-2\" class=\"section-header\">\
|
||||
<a href=\"#example-2\">Example</a></h1>",
|
||||
"<h1 id=\"example-2\" class=\"section-header\"><a href=\"#example-2\">Example</a></h1>",
|
||||
);
|
||||
t(
|
||||
&mut map,
|
||||
"# Panics",
|
||||
"<h1 id=\"panics-1\" class=\"section-header\">\
|
||||
<a href=\"#panics-1\">Panics</a></h1>",
|
||||
"<h1 id=\"panics-1\" class=\"section-header\"><a href=\"#panics-1\">Panics</a></h1>",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1062,7 +1062,7 @@ themePicker.onblur = handleThemeButtonsBlur;
|
|||
let content = format!(
|
||||
"<h1 class='fqn'>\
|
||||
<span class='in-band'>List of all crates</span>\
|
||||
</h1><ul class='mod'>{}</ul>",
|
||||
</h1><ul class='mod'>{}</ul>",
|
||||
krates
|
||||
.iter()
|
||||
.map(|s| {
|
||||
|
@ -1313,7 +1313,8 @@ impl AllTypes {
|
|||
"<h1 class='fqn'>\
|
||||
<span class='out-of-band'>\
|
||||
<span id='render-detail'>\
|
||||
<a id=\"toggle-all-docs\" href=\"javascript:void(0)\" title=\"collapse all docs\">\
|
||||
<a id=\"toggle-all-docs\" href=\"javascript:void(0)\" \
|
||||
title=\"collapse all docs\">\
|
||||
[<span class='inner'>−</span>]\
|
||||
</a>\
|
||||
</span>
|
||||
|
@ -1898,8 +1899,7 @@ fn document_non_exhaustive(w: &mut Buffer, item: &clean::Item) {
|
|||
} else {
|
||||
write!(
|
||||
w,
|
||||
"This type will require a wildcard arm in any match statements or \
|
||||
constructors."
|
||||
"This type will require a wildcard arm in any match statements or constructors."
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -2096,8 +2096,7 @@ fn item_module(w: &mut Buffer, cx: &Context, item: &clean::Item, items: &[clean:
|
|||
let doc_value = myitem.doc_value().unwrap_or("");
|
||||
write!(
|
||||
w,
|
||||
"\
|
||||
<tr class='{stab}{add}module-item'>\
|
||||
"<tr class='{stab}{add}module-item'>\
|
||||
<td><a class=\"{class}\" href=\"{href}\" \
|
||||
title='{title}'>{name}</a>{unsafety_flag}</td>\
|
||||
<td class='docblock-short'>{stab_tags}{docs}</td>\
|
||||
|
@ -2250,8 +2249,7 @@ fn item_constant(w: &mut Buffer, cx: &Context, it: &clean::Item, c: &clean::Cons
|
|||
|
||||
write!(
|
||||
w,
|
||||
"{vis}const \
|
||||
{name}: {typ}",
|
||||
"{vis}const {name}: {typ}",
|
||||
vis = it.visibility.print_with_space(),
|
||||
name = it.name.as_ref().unwrap(),
|
||||
typ = c.type_.print(),
|
||||
|
@ -2285,8 +2283,7 @@ fn item_static(w: &mut Buffer, cx: &Context, it: &clean::Item, s: &clean::Static
|
|||
render_attributes(w, it, false);
|
||||
write!(
|
||||
w,
|
||||
"{vis}static {mutability}\
|
||||
{name}: {typ}</pre>",
|
||||
"{vis}static {mutability} {name}: {typ}</pre>",
|
||||
vis = it.visibility.print_with_space(),
|
||||
mutability = s.mutability.print_with_space(),
|
||||
name = it.name.as_ref().unwrap(),
|
||||
|
@ -2503,8 +2500,7 @@ fn item_trait(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Trait,
|
|||
fn write_small_section_header(w: &mut Buffer, id: &str, title: &str, extra_content: &str) {
|
||||
write!(
|
||||
w,
|
||||
"
|
||||
<h2 id='{0}' class='small-section-header'>\
|
||||
"<h2 id='{0}' class='small-section-header'>\
|
||||
{1}<a href='#{0}' class='anchor'></a>\
|
||||
</h2>{2}",
|
||||
id, title, extra_content
|
||||
|
@ -3082,8 +3078,8 @@ fn item_enum(w: &mut Buffer, cx: &Context, it: &clean::Item, e: &clean::Enum, ca
|
|||
w,
|
||||
"<span id=\"{id}\" class=\"variant small-section-header\">\
|
||||
<a href=\"#{id}\" class=\"anchor field\"></a>\
|
||||
<code>{f}: {t}\
|
||||
</code></span>",
|
||||
<code>{f}: {t}</code>\
|
||||
</span>",
|
||||
id = id,
|
||||
f = field.name.as_ref().unwrap(),
|
||||
t = ty.print()
|
||||
|
@ -3296,23 +3292,19 @@ fn render_assoc_items(
|
|||
AssocItemRender::All => {
|
||||
write!(
|
||||
w,
|
||||
"\
|
||||
<h2 id='implementations' class='small-section-header'>\
|
||||
"<h2 id='implementations' class='small-section-header'>\
|
||||
Implementations<a href='#implementations' class='anchor'></a>\
|
||||
</h2>\
|
||||
"
|
||||
</h2>"
|
||||
);
|
||||
RenderMode::Normal
|
||||
}
|
||||
AssocItemRender::DerefFor { trait_, type_, deref_mut_ } => {
|
||||
write!(
|
||||
w,
|
||||
"\
|
||||
<h2 id='deref-methods' class='small-section-header'>\
|
||||
"<h2 id='deref-methods' class='small-section-header'>\
|
||||
Methods from {}<Target = {}>\
|
||||
<a href='#deref-methods' class='anchor'></a>\
|
||||
</h2>\
|
||||
",
|
||||
</h2>",
|
||||
trait_.print(),
|
||||
type_.print()
|
||||
);
|
||||
|
@ -3359,8 +3351,7 @@ fn render_assoc_items(
|
|||
if !impls.is_empty() {
|
||||
write!(
|
||||
w,
|
||||
"\
|
||||
<h2 id='trait-implementations' class='small-section-header'>\
|
||||
"<h2 id='trait-implementations' class='small-section-header'>\
|
||||
Trait Implementations<a href='#trait-implementations' class='anchor'></a>\
|
||||
</h2>\
|
||||
<div id='trait-implementations-list'>{}</div>",
|
||||
|
@ -3371,13 +3362,11 @@ fn render_assoc_items(
|
|||
if !synthetic.is_empty() {
|
||||
write!(
|
||||
w,
|
||||
"\
|
||||
<h2 id='synthetic-implementations' class='small-section-header'>\
|
||||
"<h2 id='synthetic-implementations' class='small-section-header'>\
|
||||
Auto Trait Implementations\
|
||||
<a href='#synthetic-implementations' class='anchor'></a>\
|
||||
</h2>\
|
||||
<div id='synthetic-implementations-list'>\
|
||||
"
|
||||
<div id='synthetic-implementations-list'>"
|
||||
);
|
||||
render_impls(cx, w, &synthetic, containing_item, cache);
|
||||
write!(w, "</div>");
|
||||
|
@ -3386,13 +3375,11 @@ fn render_assoc_items(
|
|||
if !blanket_impl.is_empty() {
|
||||
write!(
|
||||
w,
|
||||
"\
|
||||
<h2 id='blanket-implementations' class='small-section-header'>\
|
||||
"<h2 id='blanket-implementations' class='small-section-header'>\
|
||||
Blanket Implementations\
|
||||
<a href='#blanket-implementations' class='anchor'></a>\
|
||||
</h2>\
|
||||
<div id='blanket-implementations-list'>\
|
||||
"
|
||||
<div id='blanket-implementations-list'>"
|
||||
);
|
||||
render_impls(cx, w, &blanket_impl, containing_item, cache);
|
||||
write!(w, "</div>");
|
||||
|
@ -4312,8 +4299,8 @@ fn sidebar_trait(buf: &mut Buffer, it: &clean::Item, t: &clean::Trait) {
|
|||
res.sort();
|
||||
sidebar.push_str(&format!(
|
||||
"<a class=\"sidebar-title\" href=\"#foreign-impls\">\
|
||||
Implementations on Foreign Types</a><div \
|
||||
class=\"sidebar-links\">{}</div>",
|
||||
Implementations on Foreign Types</a>\
|
||||
<div class=\"sidebar-links\">{}</div>",
|
||||
res.into_iter()
|
||||
.map(|(name, id)| format!("<a href=\"#{}\">{}</a>", id, Escape(&name)))
|
||||
.collect::<Vec<_>>()
|
||||
|
|
|
@ -284,8 +284,7 @@ impl<'a> DocFolder for ImplStripper<'a> {
|
|||
if let Some(did) = typaram.def_id() {
|
||||
if did.is_local() && !self.retained.contains(&did) {
|
||||
debug!(
|
||||
"ImplStripper: stripped item in trait's generics; \
|
||||
removing impl"
|
||||
"ImplStripper: stripped item in trait's generics; removing impl"
|
||||
);
|
||||
return None;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue