aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/stylesheetlist.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2016-08-29 00:55:29 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2016-08-30 19:07:19 +0200
commit7dfb336be8dae1e2be9b898c374b6715e2a00ac7 (patch)
tree775fbf5f78d812db39ddfab79c56731262d5aded /components/script/dom/stylesheetlist.rs
parent6e1523f4ae61c16578a462c2e5335cbc95a6ef04 (diff)
downloadservo-7dfb336be8dae1e2be9b898c374b6715e2a00ac7.tar.gz
servo-7dfb336be8dae1e2be9b898c374b6715e2a00ac7.zip
Use Option<T> to return from getters
This removes the cumbersome &mut bool argument and offers overall a more readable code.
Diffstat (limited to 'components/script/dom/stylesheetlist.rs')
-rw-r--r--components/script/dom/stylesheetlist.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/components/script/dom/stylesheetlist.rs b/components/script/dom/stylesheetlist.rs
index 1b7eb643e50..721ac06525c 100644
--- a/components/script/dom/stylesheetlist.rs
+++ b/components/script/dom/stylesheetlist.rs
@@ -46,9 +46,7 @@ impl StyleSheetListMethods for StyleSheetList {
}
// check-tidy: no specs after this line
- fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Root<StyleSheet>>{
- let item = self.Item(index);
- *found = item.is_some();
- item
+ fn IndexedGetter(&self, index: u32) -> Option<Root<StyleSheet>> {
+ self.Item(index)
}
}