mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Fix some warnings in script.
This commit is contained in:
parent
fab8092581
commit
e921ce859e
12 changed files with 29 additions and 18 deletions
|
@ -308,7 +308,7 @@ pub fn jsstring_to_str(cx: *mut JSContext, s: *mut JSString) -> DOMString {
|
|||
unsafe {
|
||||
let mut length = 0;
|
||||
let chars = JS_GetStringCharsAndLength(cx, s, &mut length);
|
||||
let char_vec = slice::from_raw_buf(&chars, length as uint);
|
||||
let char_vec = slice::from_raw_parts(chars, length as uint);
|
||||
String::from_utf16(char_vec).unwrap()
|
||||
}
|
||||
}
|
||||
|
@ -367,7 +367,7 @@ impl FromJSValConvertible for ByteString {
|
|||
|
||||
let mut length = 0;
|
||||
let chars = JS_GetStringCharsAndLength(cx, string, &mut length);
|
||||
let char_vec = slice::from_raw_buf(&chars, length as uint);
|
||||
let char_vec = slice::from_raw_parts(chars, length as uint);
|
||||
|
||||
if char_vec.iter().any(|&c| c > 0xFF) {
|
||||
// XXX Throw
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue