mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue