diff options
| author | Camelid <camelidcamel@gmail.com> | 2021-04-23 14:01:00 -0700 |
|---|---|---|
| committer | Camelid <camelidcamel@gmail.com> | 2021-05-11 09:55:31 -0700 |
| commit | bcbc72767288ac2723213d0b02dfe1f98cc27948 (patch) | |
| tree | 7a69700e06e369f94dece452a7eccbb0ff083719 | |
| parent | 8048c705688fbd0822fe134210556f9af79e8f85 (diff) | |
| download | rust-bcbc72767288ac2723213d0b02dfe1f98cc27948.tar.gz rust-bcbc72767288ac2723213d0b02dfe1f98cc27948.zip | |
Apply suggestions from code review
Co-authored-by: Ivan Tham <pickfire@riseup.net>
| -rw-r--r-- | src/librustdoc/html/render/print_item.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index a2d1a6a23c6..af7745d6126 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -1550,7 +1550,7 @@ fn document_type_layout(w: &mut Buffer, cx: &Context<'_>, ty_def_id: DefId) { writeln!( w, "<div class=\"warning\"><p><strong>Note:</strong> Most layout information is \ - completely unstable and may be different between compiler versions. \ + completely unstable and may be different between compiler versions and platforms. \ The only exception is types with certain <code>repr(...)</code> attributes. \ Please see the Rust Reference’s \ <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) { if ty_layout.layout.abi.is_unsized() { writeln!(w, "<p><strong>Size:</strong> (unsized)</p>"); } else { + let bytes = ty_layout.layout.size.bytes(); writeln!( w, "<p><strong>Size:</strong> {size} byte{pl}</p>", - size = ty_layout.layout.size.bytes(), - pl = if ty_layout.layout.size.bytes() == 1 { "" } else { "s" }, + size = bytes, + pl = if bytes == 1 { "" } else { "s" }, ); } writeln!(w, "</div>"); |
