1
Fork 0

vec: replace position with iter().position_

This commit is contained in:
Daniel Micay 2013-06-18 22:59:48 -04:00
parent 49c74524e2
commit 883c966d5c
8 changed files with 13 additions and 54 deletions

View file

@ -950,7 +950,7 @@ impl serialize::Decoder for Decoder {
}
ref json => fail!("invalid variant: %?", *json),
};
let idx = match vec::position(names, |n| str::eq_slice(*n, name)) {
let idx = match names.iter().position_(|n| str::eq_slice(*n, name)) {
Some(idx) => idx,
None => fail!("Unknown variant name: %?", name),
};