summaryrefslogtreecommitdiffstats
path: root/src/librustdoc/passes/strip_priv_imports.rs
blob: 85be8fa109a7e078fb71394b43e5e5ec42158798 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Strips all private import statements (use, extern crate) from a
//! crate.
use crate::clean;
use crate::core::DocContext;
use crate::fold::DocFolder;
use crate::passes::{ImportStripper, Pass};

pub(crate) const STRIP_PRIV_IMPORTS: Pass = Pass {
    name: "strip-priv-imports",
    run: strip_priv_imports,
    description: "strips all private import statements (`use`, `extern crate`) from a crate",
};

pub(crate) fn strip_priv_imports(krate: clean::Crate, _: &mut DocContext<'_>) -> clean::Crate {
    ImportStripper.fold_crate(krate)
}