Skip to content

Commit 5b9ba4c

Browse files
committed
Remove redundant 'Import' in variant names, stop reexporting.
1 parent a400ccc commit 5b9ba4c

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
pub use self::Type::*;
1515
pub use self::VariantKind::*;
1616
pub use self::Mutability::*;
17-
pub use self::Import::*;
1817
pub use self::ItemEnum::*;
1918
pub use self::Attribute::*;
2019
pub use self::TyParamBound::*;
@@ -2527,7 +2526,7 @@ impl Clean<Vec<Item>> for doctree::Import {
25272526
});
25282527
let (mut ret, inner) = match self.node {
25292528
hir::ViewPathGlob(ref p) => {
2530-
(vec![], GlobImport(resolve_use_source(cx, p.clean(cx), self.id)))
2529+
(vec![], Import::Glob(resolve_use_source(cx, p.clean(cx), self.id)))
25312530
}
25322531
hir::ViewPathList(ref p, ref list) => {
25332532
// Attempt to inline all reexported items, but be sure
@@ -2553,17 +2552,17 @@ impl Clean<Vec<Item>> for doctree::Import {
25532552
if remaining.is_empty() {
25542553
return ret;
25552554
}
2556-
(ret, ImportList(resolve_use_source(cx, p.clean(cx), self.id),
2557-
remaining))
2555+
(ret, Import::List(resolve_use_source(cx, p.clean(cx), self.id),
2556+
remaining))
25582557
}
25592558
hir::ViewPathSimple(name, ref p) => {
25602559
if !denied {
25612560
if let Some(items) = inline::try_inline(cx, self.id, Some(name)) {
25622561
return items;
25632562
}
25642563
}
2565-
(vec![], SimpleImport(name.clean(cx),
2566-
resolve_use_source(cx, p.clean(cx), self.id)))
2564+
(vec![], Import::Simple(name.clean(cx),
2565+
resolve_use_source(cx, p.clean(cx), self.id)))
25672566
}
25682567
};
25692568
ret.push(Item {
@@ -2583,11 +2582,11 @@ impl Clean<Vec<Item>> for doctree::Import {
25832582
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
25842583
pub enum Import {
25852584
// use source as str;
2586-
SimpleImport(String, ImportSource),
2585+
Simple(String, ImportSource),
25872586
// use source::*;
2588-
GlobImport(ImportSource),
2587+
Glob(ImportSource),
25892588
// use source::{a, b, c};
2590-
ImportList(ImportSource, Vec<ViewListIdent>),
2589+
List(ImportSource, Vec<ViewListIdent>),
25912590
}
25922591

25932592
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]

src/librustdoc/html/format.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,17 +708,17 @@ impl fmt::Display for ConstnessSpace {
708708
impl fmt::Display for clean::Import {
709709
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
710710
match *self {
711-
clean::SimpleImport(ref name, ref src) => {
711+
clean::Import::Simple(ref name, ref src) => {
712712
if *name == src.path.last_name() {
713713
write!(f, "use {};", *src)
714714
} else {
715715
write!(f, "use {} as {};", *src, *name)
716716
}
717717
}
718-
clean::GlobImport(ref src) => {
718+
clean::Import::Glob(ref src) => {
719719
write!(f, "use {}::*;", *src)
720720
}
721-
clean::ImportList(ref src, ref names) => {
721+
clean::Import::List(ref src, ref names) => {
722722
write!(f, "use {}::{{", *src)?;
723723
for (i, n) in names.iter().enumerate() {
724724
if i > 0 {

0 commit comments

Comments
 (0)