]> git.lizzy.rs Git - rust.git/commitdiff
Remove redundant 'Import' in variant names, stop reexporting.
authorCorey Farwell <coreyf@rwell.org>
Sat, 1 Oct 2016 21:35:53 +0000 (17:35 -0400)
committerCorey Farwell <coreyf@rwell.org>
Mon, 3 Oct 2016 01:58:21 +0000 (21:58 -0400)
src/librustdoc/clean/mod.rs
src/librustdoc/html/format.rs

index 12093a1bc0f51241a536db85f0595f73a9114fe7..b3e65293a86752da383fc1fc66f899eab5fdf405 100644 (file)
@@ -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 @@ fn clean(&self, cx: &DocContext) -> Vec<Item> {
         });
         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 @@ fn clean(&self, cx: &DocContext) -> Vec<Item> {
                 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 @@ fn clean(&self, cx: &DocContext) -> Vec<Item> {
                         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 @@ fn clean(&self, cx: &DocContext) -> Vec<Item> {
 #[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)]
index 1b5ac24d86dd7c9f0223e34f05755f2c09953008..3f7f01a9a3b51708691317dd5ae6686d3e100f25 100644 (file)
@@ -708,17 +708,17 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 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 {