rollup merge of #20377: alexcrichton/issue-20352
This commit is contained in:
commit
074996d6f9
25 changed files with 320 additions and 359 deletions
|
@ -50,7 +50,6 @@ use std::sync::Arc;
|
|||
use externalfiles::ExternalHtml;
|
||||
|
||||
use serialize::json;
|
||||
use serialize::Encodable;
|
||||
use serialize::json::ToJson;
|
||||
use syntax::ast;
|
||||
use syntax::ast_util;
|
||||
|
@ -1096,7 +1095,7 @@ impl Context {
|
|||
try!(self.recurse(stability.name.clone(), |this| {
|
||||
let json_dst = &this.dst.join("stability.json");
|
||||
let mut json_out = BufferedWriter::new(try!(File::create(json_dst)));
|
||||
try!(stability.encode(&mut json::Encoder::new(&mut json_out)));
|
||||
try!(write!(&mut json_out, "{}", json::as_json(&stability)));
|
||||
|
||||
let mut title = stability.name.clone();
|
||||
title.push_str(" - Stability dashboard");
|
||||
|
@ -1312,7 +1311,8 @@ impl<'a> Item<'a> {
|
|||
// has anchors for the line numbers that we're linking to.
|
||||
if ast_util::is_local(self.item.def_id) {
|
||||
let mut path = Vec::new();
|
||||
clean_srcpath(&cx.src_root, self.item.source.filename.as_bytes(), |component| {
|
||||
clean_srcpath(&cx.src_root, self.item.source.filename.as_bytes(),
|
||||
|component| {
|
||||
path.push(component.to_string());
|
||||
});
|
||||
let href = if self.item.source.loline == self.item.source.hiline {
|
||||
|
@ -1714,7 +1714,7 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
|
|||
try!(write!(w, ";\n"));
|
||||
}
|
||||
if types.len() > 0 && required.len() > 0 {
|
||||
try!(w.write("\n".as_bytes()));
|
||||
try!(w.write_str("\n"));
|
||||
}
|
||||
for m in required.iter() {
|
||||
try!(write!(w, " "));
|
||||
|
@ -1722,7 +1722,7 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
|
|||
try!(write!(w, ";\n"));
|
||||
}
|
||||
if required.len() > 0 && provided.len() > 0 {
|
||||
try!(w.write("\n".as_bytes()));
|
||||
try!(w.write_str("\n"));
|
||||
}
|
||||
for m in provided.iter() {
|
||||
try!(write!(w, " "));
|
||||
|
@ -2261,8 +2261,9 @@ impl<'a> fmt::Show for Source<'a> {
|
|||
|
||||
fn item_macro(w: &mut fmt::Formatter, it: &clean::Item,
|
||||
t: &clean::Macro) -> fmt::Result {
|
||||
try!(w.write(highlight::highlight(t.source.as_slice(), Some("macro"),
|
||||
None).as_bytes()));
|
||||
try!(w.write_str(highlight::highlight(t.source.as_slice(),
|
||||
Some("macro"),
|
||||
None)[]));
|
||||
document(w, it)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue