mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Replace ByteString::as_slice() by a Deref implementation.
This commit is contained in:
parent
0a5ffc4bb0
commit
84b1b52682
3 changed files with 14 additions and 13 deletions
|
@ -400,9 +400,8 @@ impl FromJSValConvertible for USVString {
|
|||
impl ToJSValConvertible for ByteString {
|
||||
fn to_jsval(&self, cx: *mut JSContext) -> JSVal {
|
||||
unsafe {
|
||||
let slice = self.as_slice();
|
||||
let jsstr = JS_NewStringCopyN(cx, slice.as_ptr() as *const libc::c_char,
|
||||
slice.len() as libc::size_t);
|
||||
let jsstr = JS_NewStringCopyN(cx, self.as_ptr() as *const libc::c_char,
|
||||
self.len() as libc::size_t);
|
||||
if jsstr.is_null() {
|
||||
panic!("JS_NewStringCopyN failed");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue