for (i, ch) in s.bytes().enumerate() {
match ch as char {
'<' | '>' | '&' | '\'' | '"' => {
- try!(fmt.write_str(pile_o_bits.slice(last, i)));
+ try!(fmt.write_str(&pile_o_bits[last.. i]));
let s = match ch as char {
'>' => ">",
'<' => "<",
}
if last < s.len() {
- try!(fmt.write_str(pile_o_bits.slice_from(last)));
+ try!(fmt.write_str(&pile_o_bits[last..]));
}
Ok(())
}