Use str.char_offset_iter instead of manually calling str.char_range_at.

This commit is contained in:
Huon Wilson 2013-10-04 22:20:38 +10:00
parent f13438d012
commit 451519b6ff
3 changed files with 5 additions and 18 deletions

View file

@ -776,7 +776,7 @@ pub fn FindEnumStringIndex(cx: *JSContext,
return Err(());
}
let length = 0;
let chars = JS_GetStringCharsAndLength(cx, jsstr, ptr::to_unsafe_ptr(&length));
let chars = JS_GetStringCharsAndLength(cx, jsstr, &length);
if chars.is_null() {
return Err(());
}