Stop using Vec::from_raw_buf.

This commit is contained in:
Ms2ger 2015-06-26 21:20:13 +02:00
parent ef97879c27
commit a72c6ec8b6
3 changed files with 10 additions and 12 deletions

View file

@ -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 {