Use slice syntax instead of slice_to, etc.

This commit is contained in:
Nick Cameron
2014-09-24 23:41:09 +12:00
parent b5ba2f5517
commit 59976942ea
84 changed files with 313 additions and 317 deletions

View File

@@ -252,7 +252,7 @@ fn path(w: &mut fmt::Formatter, path: &clean::Path, print_all: bool,
match rel_root {
Some(root) => {
let mut root = String::from_str(root.as_slice());
for seg in path.segments.slice_to(amt).iter() {
for seg in path.segments[..amt].iter() {
if "super" == seg.name.as_slice() ||
"self" == seg.name.as_slice() {
try!(write!(w, "{}::", seg.name));
@@ -267,7 +267,7 @@ fn path(w: &mut fmt::Formatter, path: &clean::Path, print_all: bool,
}
}
None => {
for seg in path.segments.slice_to(amt).iter() {
for seg in path.segments[..amt].iter() {
try!(write!(w, "{}::", seg.name));
}
}
@@ -278,7 +278,7 @@ fn path(w: &mut fmt::Formatter, path: &clean::Path, print_all: bool,
// This is a documented path, link to it!
Some((ref fqp, shortty)) if abs_root.is_some() => {
let mut url = String::from_str(abs_root.unwrap().as_slice());
let to_link = fqp.slice_to(fqp.len() - 1);
let to_link = fqp[..fqp.len() - 1];
for component in to_link.iter() {
url.push_str(component.as_slice());
url.push_str("/");