mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +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
|
@ -105,8 +105,7 @@ impl<T: DomObject + JSTraceable + Iterable> IterableIterator<T> {
|
|||
};
|
||||
self.index.set(index + 1);
|
||||
result.map(|_| {
|
||||
assert!(!rval.is_null());
|
||||
unsafe { NonNull::new_unchecked(rval.get()) }
|
||||
NonNull::new(rval.get()).expect("got a null pointer")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue