mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 10:13:54 +00:00
Make rustdoc display extern crate
statements correctly
This commit is contained in:
parent
2f0249b3a8
commit
6b5655cb84
@ -1923,7 +1923,7 @@ impl Clean<ViewItemInner> for ast::ViewItem_ {
|
||||
|
||||
#[deriving(Clone, Encodable, Decodable)]
|
||||
pub enum ViewPath {
|
||||
// use str = source;
|
||||
// use source as str;
|
||||
SimpleImport(String, ImportSource),
|
||||
// use source::*;
|
||||
GlobImport(ImportSource),
|
||||
|
@ -1582,12 +1582,14 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context,
|
||||
clean::ViewItemItem(ref item) => {
|
||||
match item.inner {
|
||||
clean::ExternCrate(ref name, ref src, _) => {
|
||||
try!(write!(w, "<tr><td><code>extern crate {}",
|
||||
name.as_slice()));
|
||||
match *src {
|
||||
Some(ref src) => try!(write!(w, " = \"{}\"",
|
||||
src.as_slice())),
|
||||
None => {}
|
||||
Some(ref src) =>
|
||||
try!(write!(w, "<tr><td><code>extern crate \"{}\" as {}",
|
||||
src.as_slice(),
|
||||
name.as_slice())),
|
||||
None =>
|
||||
try!(write!(w, "<tr><td><code>extern crate {}",
|
||||
name.as_slice())),
|
||||
}
|
||||
try!(write!(w, ";</code></td></tr>"));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user