vec: replace position
with iter().position_
This commit is contained in:
parent
49c74524e2
commit
883c966d5c
8 changed files with 13 additions and 54 deletions
|
@ -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),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue