if let clean::ImplItem(ref i) = item.inner {
match i.trait_ {
Some(clean::ResolvedPath{ did, .. }) => {
- let v = self.implementors.entry(&did).get().unwrap_or_else(
+ let v = self.implementors.entry(did).get().unwrap_or_else(
|vacant_entry| vacant_entry.insert(Vec::with_capacity(1)));
v.push(Implementor {
def_id: item.def_id,
clean::StructFieldItem(..) |
clean::VariantItem(..) => {
((Some(*self.parent_stack.last().unwrap()),
- Some(self.stack[..self.stack.len() - 1])),
+ Some(&self.stack[..self.stack.len() - 1])),
false)
}
clean::MethodItem(..) => {
let did = *last;
let path = match self.paths.get(&did) {
Some(&(_, ItemType::Trait)) =>
- Some(self.stack[..self.stack.len() - 1]),
+ Some(&self.stack[..self.stack.len() - 1]),
// The current stack not necessarily has correlation for
// where the type was defined. On the other hand,
// `paths` always has the right information if present.
Some(&(ref fqp, ItemType::Struct)) |
Some(&(ref fqp, ItemType::Enum)) =>
- Some(fqp[..fqp.len() - 1]),
+ Some(&fqp[..fqp.len() - 1]),
Some(..) => Some(self.stack.as_slice()),
None => None
};
};
if let Some(did) = did {
- let v = self.impls.entry(&did).get().unwrap_or_else(
+ let v = self.impls.entry(did).get().unwrap_or_else(
|vacant_entry| vacant_entry.insert(Vec::with_capacity(1)));
v.push(Impl {
impl_: i,
F: FnOnce(&mut Context) -> T,
{
if s.len() == 0 {
- panic!("Unexpected empty destination: {}", self.current);
+ panic!("Unexpected empty destination: {:?}", self.current);
}
let prev = self.dst.clone();
self.dst.push(s.as_slice());
.collect::<String>();
match cache().paths.get(&it.def_id) {
Some(&(ref names, _)) => {
- for name in names[..names.len() - 1].iter() {
+ for name in (&names[..names.len() - 1]).iter() {
url.push_str(name.as_slice());
url.push_str("/");
}
Some(ref s) => s.to_string(),
};
let short = short.to_string();
- let v = map.entry(&short).get().unwrap_or_else(
+ let v = map.entry(short).get().unwrap_or_else(
|vacant_entry| vacant_entry.insert(Vec::with_capacity(1)));
v.push(myname);
}
}
-
-impl<'a> fmt::Show for Item<'a> {
+impl<'a> fmt::String for Item<'a> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
// Write the breadcrumb trail header for the top
try!(write!(fmt, "\n<h1 class='fqn'><span class='in-band'>"));
indices.sort_by(|&i1, &i2| cmp(&items[i1], &items[i2], i1, i2));
- debug!("{}", indices);
+ debug!("{:?}", indices);
let mut curty = None;
for &idx in indices.iter() {
let myitem = &items[idx];
}
struct Initializer<'a>(&'a str);
-impl<'a> fmt::Show for Initializer<'a> {
+
+impl<'a> fmt::String for Initializer<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let Initializer(s) = *self;
if s.len() == 0 { return Ok(()); }
try!(assoc_type(w, item, typaram));
try!(write!(w, "</code></h4>\n"));
}
- _ => panic!("can't make docs for trait item with name {}", item.name)
+ _ => panic!("can't make docs for trait item with name {:?}", item.name)
}
match item.doc_value() {
Some(s) if dox => {
document(w, it)
}
-impl<'a> fmt::Show for Sidebar<'a> {
+impl<'a> fmt::String for Sidebar<'a> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
let cx = self.cx;
let it = self.item;
}
}
-impl<'a> fmt::Show for Source<'a> {
+impl<'a> fmt::String for Source<'a> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
let Source(s) = *self;
let lines = s.lines().count();
cols += 1;
tmp /= 10;
}
- try!(write!(fmt, "<pre class='line-numbers'>"));
+ try!(write!(fmt, "<pre class=\"line-numbers\">"));
for i in range(1, lines + 1) {
- try!(write!(fmt, "<span id='{0}'>{0:1$}</span>\n", i, cols));
+ try!(write!(fmt, "<span id=\"{0}\">{0:1$}</span>\n", i, cols));
}
try!(write!(fmt, "</pre>"));
try!(write!(fmt, "{}", highlight::highlight(s.as_slice(), None, None)));
t: &clean::Macro) -> fmt::Result {
try!(w.write_str(highlight::highlight(t.source.as_slice(),
Some("macro"),
- None)[]));
+ None).as_slice()));
document(w, it)
}