diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2018-01-22 12:42:05 +0100 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2018-01-22 17:41:25 +0100 |
commit | 52eda6082fd32d3e28f3600858afd8f5bbc918fe (patch) | |
tree | e4318bad96b0c58beec18a2ece26d114b620c8f3 /components/script/dom/textencoder.rs | |
parent | 897a5b39c5d843cf0920870e8b4a01a84df236fc (diff) | |
download | servo-52eda6082fd32d3e28f3600858afd8f5bbc918fe.tar.gz servo-52eda6082fd32d3e28f3600858afd8f5bbc918fe.zip |
Replace NonNullJSObjectPtr with std::ptr::NonNull<JSObject>
Diffstat (limited to 'components/script/dom/textencoder.rs')
-rw-r--r-- | components/script/dom/textencoder.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/dom/textencoder.rs b/components/script/dom/textencoder.rs index 8fb97ac9e78..cc0eae4e5a2 100644 --- a/components/script/dom/textencoder.rs +++ b/components/script/dom/textencoder.rs @@ -5,7 +5,6 @@ use dom::bindings::codegen::Bindings::TextEncoderBinding; use dom::bindings::codegen::Bindings::TextEncoderBinding::TextEncoderMethods; use dom::bindings::error::Fallible; -use dom::bindings::nonnull::NonNullJSObjectPtr; use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::bindings::root::DomRoot; use dom::bindings::str::{DOMString, USVString}; @@ -14,6 +13,7 @@ use dom_struct::dom_struct; use js::jsapi::{JSContext, JSObject}; use js::typedarray::{Uint8Array, CreateWith}; use std::ptr; +use std::ptr::NonNull; #[dom_struct] pub struct TextEncoder { @@ -47,12 +47,12 @@ impl TextEncoderMethods for TextEncoder { #[allow(unsafe_code)] // https://encoding.spec.whatwg.org/#dom-textencoder-encode - unsafe fn Encode(&self, cx: *mut JSContext, input: USVString) -> NonNullJSObjectPtr { + unsafe fn Encode(&self, cx: *mut JSContext, input: USVString) -> NonNull<JSObject> { let encoded = input.0.as_bytes(); 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()) + NonNull::new_unchecked(js_object.get()) } } |