mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Use safe NonZero constructor instead of an explicit null check
This commit is contained in:
parent
10ec5a2bb0
commit
b78ac6ba6a
4 changed files with 6 additions and 10 deletions
|
@ -160,7 +160,6 @@ impl ImageDataMethods for ImageData {
|
|||
#[allow(unsafe_code)]
|
||||
// https://html.spec.whatwg.org/multipage/#dom-imagedata-data
|
||||
unsafe fn Data(&self, _: *mut JSContext) -> NonNull<JSObject> {
|
||||
assert!(!self.data.get().is_null());
|
||||
NonNull::new_unchecked(self.data.get())
|
||||
NonNull::new(self.data.get()).expect("got a null pointer")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue