mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +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
|
@ -1123,8 +1123,8 @@ impl XMLHttpRequest {
|
|||
unsafe fn arraybuffer_response(&self, cx: *mut JSContext) -> Option<NonNull<JSObject>> {
|
||||
// Step 1
|
||||
let created = self.response_arraybuffer.get();
|
||||
if !created.is_null() {
|
||||
return Some(NonNull::new_unchecked(created));
|
||||
if let Some(nonnull) = NonNull::new(created) {
|
||||
return Some(nonnull)
|
||||
}
|
||||
|
||||
// Step 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue