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

@ -136,10 +136,8 @@ impl StorageMethods for Storage {
}
// check-tidy: no specs after this line
fn NamedGetter(&self, name: DOMString, found: &mut bool) -> Option<DOMString> {
let item = self.GetItem(name);
*found = item.is_some();
item
fn NamedGetter(&self, name: DOMString) -> Option<DOMString> {
self.GetItem(name)
}
fn NamedSetter(&self, name: DOMString, value: DOMString) -> ErrorResult {