mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Replace NonNullJSObjectPtr with std::ptr::NonNull<JSObject>
This commit is contained in:
parent
897a5b39c5
commit
52eda6082f
22 changed files with 79 additions and 111 deletions
|
@ -5,7 +5,6 @@
|
|||
use dom::bindings::codegen::Bindings::ImageDataBinding;
|
||||
use dom::bindings::codegen::Bindings::ImageDataBinding::ImageDataMethods;
|
||||
use dom::bindings::error::{Fallible, Error};
|
||||
use dom::bindings::nonnull::NonNullJSObjectPtr;
|
||||
use dom::bindings::reflector::{Reflector, reflect_dom_object};
|
||||
use dom::bindings::root::DomRoot;
|
||||
use dom::globalscope::GlobalScope;
|
||||
|
@ -16,6 +15,7 @@ use js::rust::Runtime;
|
|||
use js::typedarray::{Uint8ClampedArray, CreateWith};
|
||||
use std::default::Default;
|
||||
use std::ptr;
|
||||
use std::ptr::NonNull;
|
||||
use std::vec::Vec;
|
||||
|
||||
#[dom_struct]
|
||||
|
@ -159,8 +159,8 @@ impl ImageDataMethods for ImageData {
|
|||
|
||||
#[allow(unsafe_code)]
|
||||
// https://html.spec.whatwg.org/multipage/#dom-imagedata-data
|
||||
unsafe fn Data(&self, _: *mut JSContext) -> NonNullJSObjectPtr {
|
||||
unsafe fn Data(&self, _: *mut JSContext) -> NonNull<JSObject> {
|
||||
assert!(!self.data.get().is_null());
|
||||
NonNullJSObjectPtr::new_unchecked(self.data.get())
|
||||
NonNull::new_unchecked(self.data.get())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue