Remove redundant 'Import' in variant names, stop reexporting.
This commit is contained in:
parent
a400cccd54
commit
5b9ba4c550
2 changed files with 11 additions and 12 deletions
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue