Use slice syntax instead of slice_to, etc.

This commit is contained in:
Nick Cameron
2014-09-24 23:41:09 +12:00
parent a70a0374e2
commit 40b9f5ded5
81 changed files with 331 additions and 363 deletions

View File

@@ -249,7 +249,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));
@@ -264,7 +264,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));
}
}
@@ -275,7 +275,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("/");