Remove some as_slice calls.

This commit is contained in:
Ms2ger 2015-04-24 17:40:22 +02:00
parent 4ee89363fb
commit 6a55ae06d7
34 changed files with 79 additions and 79 deletions

View file

@ -22,9 +22,9 @@ pub fn match_ty_unwrap<'a>(ty: &'a Ty, segments: &[&str]) -> Option<&'a [P<Ty>]>
// however the more efficient way is to simply reverse the iterators and zip them
// which will compare them in reverse until one of them runs out of segments
if seg.iter().rev().zip(segments.iter().rev()).all(|(a,b)| a.identifier.as_str() == *b) {
match seg.as_slice().last() {
match seg.last() {
Some(&PathSegment {parameters: AngleBracketedParameters(ref a), ..}) => {
Some(a.types.as_slice())
Some(&a.types)
}
_ => None
}