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
|
|
@ -798,7 +798,7 @@ impl Clean<Item> for ast::Method {
|
|||
let all_inputs = &self.pe_fn_decl().inputs;
|
||||
let inputs = match self.pe_explicit_self().node {
|
||||
ast::SelfStatic => all_inputs.as_slice(),
|
||||
_ => all_inputs[1..]
|
||||
_ => all_inputs.index(&(1..))
|
||||
};
|
||||
let decl = FnDecl {
|
||||
inputs: Arguments {
|
||||
|
|
@ -836,7 +836,7 @@ impl Clean<Item> for ast::TypeMethod {
|
|||
fn clean(&self, cx: &DocContext) -> Item {
|
||||
let inputs = match self.explicit_self.node {
|
||||
ast::SelfStatic => self.decl.inputs.as_slice(),
|
||||
_ => self.decl.inputs[1..]
|
||||
_ => self.decl.inputs.index(&(1..))
|
||||
};
|
||||
let decl = FnDecl {
|
||||
inputs: Arguments {
|
||||
|
|
@ -1132,7 +1132,7 @@ impl<'tcx> Clean<Item> for ty::Method<'tcx> {
|
|||
self.fty.sig.clone()),
|
||||
s => {
|
||||
let sig = ty::Binder(ty::FnSig {
|
||||
inputs: self.fty.sig.0.inputs[1..].to_vec(),
|
||||
inputs: self.fty.sig.0.inputs.index(&(1..)).to_vec(),
|
||||
..self.fty.sig.0.clone()
|
||||
});
|
||||
let s = match s {
|
||||
|
|
|
|||
|
|
@ -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