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:
Anthony Ramine 2016-08-29 00:55:29 +02:00
parent 6e1523f4ae
commit 7dfb336be8
22 changed files with 72 additions and 109 deletions

View file

@ -23,10 +23,10 @@ impl TestBindingProxyMethods for TestBindingProxy {
fn SetItem(&self, _: u32, _: DOMString) -> () {}
fn RemoveItem(&self, _: DOMString) -> () {}
fn Stringifier(&self) -> DOMString { DOMString::new() }
fn IndexedGetter(&self, _: u32, _: &mut bool) -> DOMString { DOMString::new() }
fn IndexedGetter(&self, _: u32) -> Option<DOMString> { None }
fn NamedDeleter(&self, _: DOMString) -> () {}
fn IndexedSetter(&self, _: u32, _: DOMString) -> () {}
fn NamedSetter(&self, _: DOMString, _: DOMString) -> () {}
fn NamedGetter(&self, _: DOMString, _: &mut bool) -> DOMString { DOMString::new() }
fn NamedGetter(&self, _: DOMString) -> Option<DOMString> { None }
}