From b6851ba3c9eccfb1def7fdb5e4c64edcad55e612 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sat, 30 Oct 2021 02:07:37 +0000 Subject: [PATCH] Remove unnecessary `macro_use`s in rustdoc --- src/librustdoc/html/render/context.rs | 4 ++-- src/librustdoc/html/render/mod.rs | 1 + src/librustdoc/html/render/write_shared.rs | 1 + src/librustdoc/lib.rs | 7 ++----- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs index 0e29cc85f9e..1ce6a5c00be 100644 --- a/src/librustdoc/html/render/context.rs +++ b/src/librustdoc/html/render/context.rs @@ -22,8 +22,7 @@ BASIC_KEYWORDS, }; -use crate::clean; -use crate::clean::ExternalCrate; +use crate::clean::{self, ExternalCrate}; use crate::config::RenderOptions; use crate::docfs::{DocFS, PathError}; use crate::error::Error; @@ -35,6 +34,7 @@ use crate::html::markdown::{self, plain_text_summary, ErrorCodes, IdMap}; use crate::html::{layout, sources}; use crate::scrape_examples::AllCallLocations; +use crate::try_err; /// Major driving force in all rustdoc rendering. This contains information /// about where in the tree-like hierarchy rendering is occurring and controls diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 07dea624d7c..0354b87e7b9 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -77,6 +77,7 @@ use crate::html::markdown::{HeadingOffset, Markdown, MarkdownHtml, MarkdownSummaryLine}; use crate::html::sources; use crate::scrape_examples::CallData; +use crate::try_none; /// A pair of name and its optional document. crate type NameDoc = (String, Option); diff --git a/src/librustdoc/html/render/write_shared.rs b/src/librustdoc/html/render/write_shared.rs index 34f1b4cd684..27277015cd1 100644 --- a/src/librustdoc/html/render/write_shared.rs +++ b/src/librustdoc/html/render/write_shared.rs @@ -17,6 +17,7 @@ use crate::docfs::PathError; use crate::error::Error; use crate::html::{layout, static_files}; +use crate::{try_err, try_none}; static FILES_UNVERSIONED: Lazy> = Lazy::new(|| { map! { diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 93dffc27659..b50fbf58bae 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -103,17 +103,14 @@ }} } -#[macro_use] -mod externalfiles; - mod clean; mod config; mod core; mod docfs; +mod doctest; mod doctree; -#[macro_use] mod error; -mod doctest; +mod externalfiles; mod fold; mod formats; // used by the error-index generator, so it needs to be public -- GitLab