AST/HIR: Clarify what the optional name in extern crate items mean
This commit is contained in:
@@ -1174,15 +1174,10 @@ impl<'a> State<'a> {
|
||||
self.print_outer_attributes(&item.attrs)?;
|
||||
self.ann.pre(self, NodeItem(item))?;
|
||||
match item.node {
|
||||
ast::ItemKind::ExternCrate(ref optional_path) => {
|
||||
ast::ItemKind::ExternCrate(orig_name) => {
|
||||
self.head(&visibility_qualified(&item.vis, "extern crate"))?;
|
||||
if let Some(p) = *optional_path {
|
||||
let val = p.as_str();
|
||||
if val.contains('-') {
|
||||
self.print_string(&val, ast::StrStyle::Cooked)?;
|
||||
} else {
|
||||
self.print_name(p)?;
|
||||
}
|
||||
if let Some(orig_name) = orig_name {
|
||||
self.print_name(orig_name)?;
|
||||
self.s.space()?;
|
||||
self.s.word("as")?;
|
||||
self.s.space()?;
|
||||
|
||||
Reference in New Issue
Block a user