From e29f46ce3761e7a3e8bf535bc55b7f8b58e4c0a7 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Thu, 22 Apr 2021 20:14:24 -0400 Subject: 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. --- src/librustdoc/html/render/print_item.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/librustdoc/html/render') 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("

"); let name = match *item.kind { - clean::ModuleItem(ref m) => { - if m.is_crate { + clean::ModuleItem(_) => { + if item.is_crate() { "Crate " } else { "Module " -- cgit 1.4.1-3-g733a5