diff options
| author | Corey Farwell <coreyf@rwell.org> | 2016-10-01 17:35:53 -0400 |
|---|---|---|
| committer | Corey Farwell <coreyf@rwell.org> | 2016-10-02 21:58:21 -0400 |
| commit | 5b9ba4c5505f3f3c1c42c50004f2bab010dec0b0 (patch) | |
| tree | a15eba5dbc4302e0bc6c88e7cefedb398fe070ab | |
| parent | a400cccd5439cb16e8be087f14ca3109318d7435 (diff) | |
Remove redundant 'Import' in variant names, stop reexporting.
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 17 | ||||
| -rw-r--r-- | src/librustdoc/html/format.rs | 6 |
2 files changed, 11 insertions, 12 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 12093a1bc0f..b3e65293a86 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -14,7 +14,6 @@ pub use self::Type::*; pub use self::VariantKind::*; pub use self::Mutability::*; -pub use self::Import::*; pub use self::ItemEnum::*; pub use self::Attribute::*; pub use self::TyParamBound::*; @@ -2527,7 +2526,7 @@ impl Clean<Vec<Item>> for doctree::Import { }); let (mut ret, inner) = match self.node { hir::ViewPathGlob(ref p) => { - (vec![], GlobImport(resolve_use_source(cx, p.clean(cx), self.id))) + (vec![], Import::Glob(resolve_use_source(cx, p.clean(cx), self.id))) } hir::ViewPathList(ref p, ref list) => { // Attempt to inline all reexported items, but be sure @@ -2553,8 +2552,8 @@ impl Clean<Vec<Item>> for doctree::Import { if remaining.is_empty() { return ret; } - (ret, ImportList(resolve_use_source(cx, p.clean(cx), self.id), - remaining)) + (ret, Import::List(resolve_use_source(cx, p.clean(cx), self.id), + remaining)) } hir::ViewPathSimple(name, ref p) => { if !denied { @@ -2562,8 +2561,8 @@ impl Clean<Vec<Item>> for doctree::Import { return items; } } - (vec![], SimpleImport(name.clean(cx), - resolve_use_source(cx, p.clean(cx), self.id))) + (vec![], Import::Simple(name.clean(cx), + resolve_use_source(cx, p.clean(cx), self.id))) } }; ret.push(Item { @@ -2583,11 +2582,11 @@ impl Clean<Vec<Item>> for doctree::Import { #[derive(Clone, RustcEncodable, RustcDecodable, Debug)] pub enum Import { // use source as str; - SimpleImport(String, ImportSource), + Simple(String, ImportSource), // use source::*; - GlobImport(ImportSource), + Glob(ImportSource), // use source::{a, b, c}; - ImportList(ImportSource, Vec<ViewListIdent>), + List(ImportSource, Vec<ViewListIdent>), } #[derive(Clone, RustcEncodable, RustcDecodable, Debug)] diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 1b5ac24d86d..3f7f01a9a3b 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -708,17 +708,17 @@ impl fmt::Display for ConstnessSpace { impl fmt::Display for clean::Import { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { - clean::SimpleImport(ref name, ref src) => { + clean::Import::Simple(ref name, ref src) => { if *name == src.path.last_name() { write!(f, "use {};", *src) } else { write!(f, "use {} as {};", *src, *name) } } - clean::GlobImport(ref src) => { + clean::Import::Glob(ref src) => { write!(f, "use {}::*;", *src) } - clean::ImportList(ref src, ref names) => { + clean::Import::List(ref src, ref names) => { write!(f, "use {}::{{", *src)?; for (i, n) in names.iter().enumerate() { if i > 0 { |
