summary refs log tree commit diff
path: root/src/librustdoc/html/render
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2021-04-22 20:14:24 -0400
committerJoshua Nelson <jyn514@gmail.com>2021-04-23 15:33:18 -0400
commite29f46ce3761e7a3e8bf535bc55b7f8b58e4c0a7 (patch)
treeaf996c97d3e15749a3fbda32d5a3ebc6276cc324 /src/librustdoc/html/render
parent484c61943f818272719bac81f6d5709fc5456438 (diff)
downloadrust-e29f46ce3761e7a3e8bf535bc55b7f8b58e4c0a7.tar.gz
rust-e29f46ce3761e7a3e8bf535bc55b7f8b58e4c0a7.zip
rustdoc: Remove unnecessary `is_crate` field from doctree::Module and clean::Module
It can be calculated on-demand even without a TyCtxt.

This also changed `from_item_kind` to take a whole item, which avoids
having to add more and more parameters.
Diffstat (limited to 'src/librustdoc/html/render')
-rw-r--r--src/librustdoc/html/render/print_item.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs
index a303ca956d8..4d338417b92 100644
--- a/src/librustdoc/html/render/print_item.rs
+++ b/src/librustdoc/html/render/print_item.rs
@@ -28,8 +28,8 @@ pub(super) fn print_item(cx: &Context<'_>, item: &clean::Item, buf: &mut Buffer)
     // Write the breadcrumb trail header for the top
     buf.write_str("<h1 class=\"fqn\"><span class=\"in-band\">");
     let name = match *item.kind {
-        clean::ModuleItem(ref m) => {
-            if m.is_crate {
+        clean::ModuleItem(_) => {
+            if item.is_crate() {
                 "Crate "
             } else {
                 "Module "