Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit bcbc727

Browse files
camelidpickfire
andcommitted
Apply suggestions from code review
Co-authored-by: Ivan Tham <pickfire@riseup.net>
1 parent 8048c70 commit bcbc727

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustdoc/html/render/print_item.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,7 @@ fn document_type_layout(w: &mut Buffer, cx: &Context<'_>, ty_def_id: DefId) {
15501550
writeln!(
15511551
w,
15521552
"<div class=\"warning\"><p><strong>Note:</strong> Most layout information is \
1553-
completely unstable and may be different between compiler versions. \
1553+
completely unstable and may be different between compiler versions and platforms. \
15541554
The only exception is types with certain <code>repr(...)</code> attributes. \
15551555
Please see the Rust Reference’s \
15561556
<a href=\"https://doc.rust-lang.org/reference/type-layout.html\">“Type Layout”</a> \
@@ -1559,11 +1559,12 @@ fn document_type_layout(w: &mut Buffer, cx: &Context<'_>, ty_def_id: DefId) {
15591559
if ty_layout.layout.abi.is_unsized() {
15601560
writeln!(w, "<p><strong>Size:</strong> (unsized)</p>");
15611561
} else {
1562+
let bytes = ty_layout.layout.size.bytes();
15621563
writeln!(
15631564
w,
15641565
"<p><strong>Size:</strong> {size} byte{pl}</p>",
1565-
size = ty_layout.layout.size.bytes(),
1566-
pl = if ty_layout.layout.size.bytes() == 1 { "" } else { "s" },
1566+
size = bytes,
1567+
pl = if bytes == 1 { "" } else { "s" },
15671568
);
15681569
}
15691570
writeln!(w, "</div>");

0 commit comments

Comments
 (0)