diff options
author | chansuke <chansuke@georepublic.de> | 2018-09-18 23:24:15 +0900 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2018-09-19 17:40:47 -0400 |
commit | c37a345dc9f4dda6ea29c42f96f6c7201c42cbac (patch) | |
tree | 1f05b49bac02318455a59d5b143c186fd872bdb9 /components/script/dom/testbindingiterable.rs | |
parent | 2ca7a134736bb4759ff209c1bc0b6dc3cc1984c9 (diff) | |
download | servo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.tar.gz servo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.zip |
Format script component
Diffstat (limited to 'components/script/dom/testbindingiterable.rs')
-rw-r--r-- | components/script/dom/testbindingiterable.rs | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/components/script/dom/testbindingiterable.rs b/components/script/dom/testbindingiterable.rs index 06a9dda6b37..60c345ce9f1 100644 --- a/components/script/dom/testbindingiterable.rs +++ b/components/script/dom/testbindingiterable.rs @@ -21,10 +21,14 @@ pub struct TestBindingIterable { impl TestBindingIterable { fn new(global: &GlobalScope) -> DomRoot<TestBindingIterable> { - reflect_dom_object(Box::new(TestBindingIterable { - reflector: Reflector::new(), - vals: DomRefCell::new(vec![]), - }), global, TestBindingIterableBinding::Wrap) + reflect_dom_object( + Box::new(TestBindingIterable { + reflector: Reflector::new(), + vals: DomRefCell::new(vec![]), + }), + global, + TestBindingIterableBinding::Wrap, + ) } pub fn Constructor(global: &GlobalScope) -> Fallible<DomRoot<TestBindingIterable>> { @@ -33,9 +37,15 @@ impl TestBindingIterable { } impl TestBindingIterableMethods for TestBindingIterable { - fn Add(&self, v: DOMString) { self.vals.borrow_mut().push(v); } - fn Length(&self) -> u32 { self.vals.borrow().len() as u32 } - fn GetItem(&self, n: u32) -> DOMString { self.IndexedGetter(n).unwrap_or_default() } + fn Add(&self, v: DOMString) { + self.vals.borrow_mut().push(v); + } + fn Length(&self) -> u32 { + self.vals.borrow().len() as u32 + } + fn GetItem(&self, n: u32) -> DOMString { + self.IndexedGetter(n).unwrap_or_default() + } fn IndexedGetter(&self, n: u32) -> Option<DOMString> { self.vals.borrow().get(n as usize).cloned() } |