mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
Use str.char_offset_iter instead of manually calling str.char_range_at.
This commit is contained in:
parent
f13438d012
commit
451519b6ff
3 changed files with 5 additions and 18 deletions
|
@ -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(());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue