aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/globalscope.rs
diff options
context:
space:
mode:
authorOluwatobi Sofela <60105594+oluwatobiss@users.noreply.github.com>2024-03-22 14:48:03 +0100
committerGitHub <noreply@github.com>2024-03-22 13:48:03 +0000
commitbae77671f85481503ab563c20ed488cf883436fa (patch)
treecd718b8b5e9949052ebde65f9f5f2ce7fc60ef07 /components/script/dom/globalscope.rs
parent3e9b8089381492edeb0992c93776d39bf1df2607 (diff)
downloadservo-bae77671f85481503ab563c20ed488cf883436fa.tar.gz
servo-bae77671f85481503ab563c20ed488cf883436fa.zip
clippy: Fix `unnecessary_cast` warnings in `components/script` (#31823)
* clippy: Fix unnecessary cast warnings * clippy: Replace redundant field names with their shorthand alternatives * clippy: Delete struct pattern dereferencings
Diffstat (limited to 'components/script/dom/globalscope.rs')
-rw-r--r--components/script/dom/globalscope.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs
index 04c5933eef5..f0029bdf3d3 100644
--- a/components/script/dom/globalscope.rs
+++ b/components/script/dom/globalscope.rs
@@ -2001,7 +2001,7 @@ impl GlobalScope {
let stream = ReadableStream::new_with_external_underlying_source(
self,
- ExternalUnderlyingSource::Blob(size as usize),
+ ExternalUnderlyingSource::Blob(size),
);
let recv = self.send_msg(file_id);
@@ -3171,7 +3171,7 @@ impl GlobalScope {
}
}
for i in (0..gamepad_list.Length()).rev() {
- if gamepad_list.Item(i as u32).is_none() {
+ if gamepad_list.Item(i).is_none() {
gamepad_list.remove_gamepad(i as usize);
} else {
break;
@@ -3211,7 +3211,7 @@ impl GlobalScope {
if !window.Navigator().has_gamepad_gesture() && contains_user_gesture(update_type) {
window.Navigator().set_has_gamepad_gesture(true);
for i in 0..gamepad_list.Length() {
- if let Some(gamepad) = gamepad_list.Item(i as u32) {
+ if let Some(gamepad) = gamepad_list.Item(i) {
gamepad.set_exposed(true);
gamepad.update_timestamp(*current_time);
let new_gamepad = Trusted::new(&*gamepad);