Skip to content

Commit 6319202

Browse files
committed
Use functions instead of wrapping methods
1 parent ca02fde commit 6319202

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

src/librustdoc/html/render/print_item.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,15 +1820,6 @@ fn item_struct(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean
18201820
}
18211821

18221822
impl<'a, 'cx: 'a> ItemStruct<'a, 'cx> {
1823-
fn render_attributes_in_code<'b>(
1824-
&'b self,
1825-
) -> impl fmt::Display + Captures<'a> + 'b + Captures<'cx> {
1826-
display_fn(move |f| {
1827-
let tcx = self.cx.borrow().tcx();
1828-
write!(f, "{}", render_attributes_in_code(self.it, tcx))
1829-
})
1830-
}
1831-
18321823
fn render_struct<'b>(&'b self) -> impl fmt::Display + Captures<'a> + 'b + Captures<'cx> {
18331824
display_fn(move |f| {
18341825
let cx = self.cx.borrow();
@@ -1865,14 +1856,6 @@ fn item_struct(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean
18651856
&& self.fields().peekable().peek().is_some()
18661857
}
18671858

1868-
fn document_non_exhaustive_header(&self) -> &str {
1869-
document_non_exhaustive_header(self.it)
1870-
}
1871-
1872-
fn document_non_exhaustive(&self) -> impl fmt::Display + 'a {
1873-
document_non_exhaustive(self.it)
1874-
}
1875-
18761859
fn render_field_in_span<'b>(
18771860
&'b self,
18781861
index: &'b usize,

src/librustdoc/html/templates/item_struct.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<pre class="rust item-decl"><code>
2-
{{ self.render_attributes_in_code() | safe }}
2+
{{ self::render_attributes_in_code(self.it, self.cx.borrow().tcx()) | safe }}
33
{{ self.render_struct() | safe }}
44
</code></pre>
55
{{ self.document() | safe }}
@@ -10,10 +10,10 @@ <h2 id="fields" class="fields small-section header">
1010
{% else %}
1111
Tuple Fields
1212
{% endif %}
13-
{{ self.document_non_exhaustive_header() | safe }}
13+
{{ self::document_non_exhaustive_header(self.it) | safe }}
1414
<a href="#fields" class="anchor">§</a>
1515
</h2>
16-
{{ self.document_non_exhaustive() | safe }}
16+
{{ self::document_non_exhaustive(self.it) | safe }}
1717
{% for (index, (field, ty)) in self.fields().enumerate() %}
1818
{{ self.render_field_in_span(index, field, ty) | safe }}
1919
{{ self.document_field(field) | safe }}

0 commit comments

Comments
 (0)