Fix tyvar_behind_raw_pointer warnings

https://github.com/rust-lang/rust/issues/46906
This commit is contained in:
Simon Sapin 2018-01-04 18:13:44 +01:00
parent cee2aadd82
commit 4d459bce32
20 changed files with 55 additions and 53 deletions

View file

@ -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())