Skip to content

Commit df40243

Browse files
committed
Use functions instead of wrapping methods
1 parent 71e5bb8 commit df40243

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
@@ -1598,15 +1598,6 @@ fn item_struct(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean
15981598
}
15991599

16001600
impl<'a, 'cx: 'a> ItemStruct<'a, 'cx> {
1601-
fn render_attributes_in_code<'b>(
1602-
&'b self,
1603-
) -> impl fmt::Display + Captures<'a> + 'b + Captures<'cx> {
1604-
display_fn(move |f| {
1605-
let tcx = self.cx.borrow().tcx();
1606-
write!(f, "{}", render_attributes_in_code(self.it, tcx))
1607-
})
1608-
}
1609-
16101601
fn render_struct<'b>(&'b self) -> impl fmt::Display + Captures<'a> + 'b + Captures<'cx> {
16111602
display_fn(move |f| {
16121603
let cx = self.cx.borrow();
@@ -1643,14 +1634,6 @@ fn item_struct(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean
16431634
&& self.fields().peekable().peek().is_some()
16441635
}
16451636

1646-
fn document_non_exhaustive_header(&self) -> &str {
1647-
document_non_exhaustive_header(self.it)
1648-
}
1649-
1650-
fn document_non_exhaustive(&self) -> impl fmt::Display + 'a {
1651-
document_non_exhaustive(self.it)
1652-
}
1653-
16541637
fn render_field_in_span<'b>(
16551638
&'b self,
16561639
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)