Replace full slice notation with index calls
This commit is contained in:
parent
918255ef8c
commit
f7ff37e4c5
225 changed files with 2166 additions and 2139 deletions
|
|
@ -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[..amt].iter() {
|
||||
for seg in path.segments.index(&(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[..amt].iter() {
|
||||
for seg in path.segments.index(&(0..amt)).iter() {
|
||||
try!(write!(w, "{}::", seg.name));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ pub fn highlight(src: &str, class: Option<&str>, id: Option<&str>) -> String {
|
|||
class,
|
||||
id,
|
||||
&mut out).unwrap();
|
||||
String::from_utf8_lossy(out[]).into_owned()
|
||||
String::from_utf8_lossy(out.index(&FullRange)).into_owned()
|
||||
}
|
||||
|
||||
/// Exhausts the `lexer` writing the output into `out`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue