mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Fix tyvar_behind_raw_pointer warnings
https://github.com/rust-lang/rust/issues/46906
This commit is contained in:
parent
cee2aadd82
commit
4d459bce32
20 changed files with 55 additions and 53 deletions
|
@ -11,7 +11,7 @@ use dom::bindings::root::DomRoot;
|
|||
use dom::bindings::str::{DOMString, USVString};
|
||||
use dom::globalscope::GlobalScope;
|
||||
use dom_struct::dom_struct;
|
||||
use js::jsapi::JSContext;
|
||||
use js::jsapi::{JSContext, JSObject};
|
||||
use js::typedarray::{Uint8Array, CreateWith};
|
||||
use std::ptr;
|
||||
|
||||
|
@ -50,7 +50,7 @@ impl TextEncoderMethods for TextEncoder {
|
|||
unsafe fn Encode(&self, cx: *mut JSContext, input: USVString) -> NonNullJSObjectPtr {
|
||||
let encoded = input.0.as_bytes();
|
||||
|
||||
rooted!(in(cx) let mut js_object = ptr::null_mut());
|
||||
rooted!(in(cx) let mut js_object = ptr::null_mut::<JSObject>());
|
||||
assert!(Uint8Array::create(cx, CreateWith::Slice(&encoded), js_object.handle_mut()).is_ok());
|
||||
|
||||
NonNullJSObjectPtr::new_unchecked(js_object.get())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue