aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/testbindingpairiterable.rs
diff options
context:
space:
mode:
authorJose Monagas <43023347+JoseTMonagas@users.noreply.github.com>2024-08-15 22:31:30 +0300
committerGitHub <noreply@github.com>2024-08-15 19:31:30 +0000
commita34920b6058016f026c2b710224b9227826fcf85 (patch)
treeced35fbe73845d0a2a326fd5bb3c5c7b69bf090b /components/script/dom/testbindingpairiterable.rs
parent386a067c4b83b9fd60200e07c9668aba2a667944 (diff)
downloadservo-a34920b6058016f026c2b710224b9227826fcf85.tar.gz
servo-a34920b6058016f026c2b710224b9227826fcf85.zip
fix(clippy): Clippy suggestions in components/script/dom/* (#33072)
Signed-off-by: Jose T. Monagas <josetmonagas@proton.me> Co-authored-by: Jose T. Monagas <josetmonagas@proton.me>
Diffstat (limited to 'components/script/dom/testbindingpairiterable.rs')
-rw-r--r--components/script/dom/testbindingpairiterable.rs11
1 files changed, 2 insertions, 9 deletions
diff --git a/components/script/dom/testbindingpairiterable.rs b/components/script/dom/testbindingpairiterable.rs
index 6496f3c9a07..aaed63bf715 100644
--- a/components/script/dom/testbindingpairiterable.rs
+++ b/components/script/dom/testbindingpairiterable.rs
@@ -29,19 +29,12 @@ impl Iterable for TestBindingPairIterable {
self.map.borrow().len() as u32
}
fn get_value_at_index(&self, index: u32) -> u32 {
- *self
- .map
- .borrow()
- .iter()
- .nth(index as usize)
- .map(|a| &a.1)
- .unwrap()
+ *self.map.borrow().get(index as usize).map(|a| &a.1).unwrap()
}
fn get_key_at_index(&self, index: u32) -> DOMString {
self.map
.borrow()
- .iter()
- .nth(index as usize)
+ .get(index as usize)
.map(|a| &a.0)
.unwrap()
.clone()