cleanup: s/v.slice*()
/&v[a..b]
/g + remove redundant as_slice()
calls
This commit is contained in:
parent
d77f6d5366
commit
bce81e2464
59 changed files with 156 additions and 160 deletions
|
@ -1348,7 +1348,7 @@ impl<'a> Item<'a> {
|
|||
};
|
||||
Some(format!("{root}{path}/{file}?gotosrc={goto}",
|
||||
root = root,
|
||||
path = path.slice_to(path.len() - 1).connect("/"),
|
||||
path = path[..path.len() - 1].connect("/"),
|
||||
file = item_path(self.item),
|
||||
goto = self.item.def_id.node))
|
||||
}
|
||||
|
@ -1793,7 +1793,7 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
|
|||
cx.current.connect("/")
|
||||
} else {
|
||||
let path = &cache.external_paths[it.def_id];
|
||||
path.slice_to(path.len() - 1).connect("/")
|
||||
path[..path.len() - 1].connect("/")
|
||||
},
|
||||
ty = shortty(it).to_static_str(),
|
||||
name = *it.name.as_ref().unwrap()));
|
||||
|
@ -2197,9 +2197,7 @@ impl<'a> fmt::Display for Sidebar<'a> {
|
|||
try!(write!(fmt, "::<wbr>"));
|
||||
}
|
||||
try!(write!(fmt, "<a href='{}index.html'>{}</a>",
|
||||
cx.root_path
|
||||
.as_slice()
|
||||
.slice_to((cx.current.len() - i - 1) * 3),
|
||||
&cx.root_path[..(cx.current.len() - i - 1) * 3],
|
||||
*name));
|
||||
}
|
||||
try!(write!(fmt, "</p>"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue