use slicing sugar

This commit is contained in:
Jorge Aparicio
2015-01-07 11:58:31 -05:00
parent 6e2bfe4ae8
commit 517f1cc63c
198 changed files with 2383 additions and 2405 deletions

View File

@@ -311,7 +311,7 @@ fn path<F, G>(w: &mut fmt::Formatter,
match rel_root {
Some(root) => {
let mut root = String::from_str(root.as_slice());
for seg in path.segments.index(&(0..amt)).iter() {
for seg in path.segments[0..amt].iter() {
if "super" == seg.name ||
"self" == seg.name {
try!(write!(w, "{}::", seg.name));
@@ -326,7 +326,7 @@ fn path<F, G>(w: &mut fmt::Formatter,
}
}
None => {
for seg in path.segments.index(&(0..amt)).iter() {
for seg in path.segments[0..amt].iter() {
try!(write!(w, "{}::", seg.name));
}
}