mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Use Option<T> to return from getters
This removes the cumbersome &mut bool argument and offers overall a more readable code.
This commit is contained in:
parent
6e1523f4ae
commit
7dfb336be8
22 changed files with 72 additions and 109 deletions
|
@ -88,8 +88,7 @@ impl XMLDocumentMethods for XMLDocument {
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-tree-accessors:dom-document-nameditem-filter
|
||||
fn NamedGetter(&self, _cx: *mut JSContext, name: DOMString, found: &mut bool)
|
||||
-> NonZero<*mut JSObject> {
|
||||
self.upcast::<Document>().NamedGetter(_cx, name, found)
|
||||
fn NamedGetter(&self, _cx: *mut JSContext, name: DOMString) -> Option<NonZero<*mut JSObject>> {
|
||||
self.upcast::<Document>().NamedGetter(_cx, name)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue