mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Stop using Vec::from_raw_buf.
This commit is contained in:
parent
ef97879c27
commit
a72c6ec8b6
3 changed files with 10 additions and 12 deletions
|
@ -448,11 +448,11 @@ impl FromJSValConvertible for ByteString {
|
|||
};
|
||||
assert!(!chars.is_null());
|
||||
|
||||
let char_vec = unsafe {
|
||||
Vec::from_raw_buf(chars as *mut u8, length as usize)
|
||||
let char_slice = unsafe {
|
||||
slice::from_raw_parts(chars as *mut u8, length as usize)
|
||||
};
|
||||
|
||||
return Ok(ByteString::new(char_vec));
|
||||
return Ok(ByteString::new(char_slice.to_vec()));
|
||||
}
|
||||
|
||||
unsafe {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue