clippy: Fix warnings in components/script & components/webgpu (#33653)

* clippy: Fix warnings in component/script & component/webgpu

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>

* fix: use same variable name in if-let block

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>

---------

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
This commit is contained in:
tanishka 2024-10-05 19:40:32 +05:30 committed by GitHub
parent ad8ba49d2c
commit 0a5540f6a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 10 deletions

View file

@ -255,7 +255,7 @@ impl GPUCanvasContext {
.send(WebGPURequest::UpdateContext {
context_id: self.context_id,
size: drawing_buffer.size,
configuration: drawing_buffer.config.clone(),
configuration: drawing_buffer.config,
})
.expect("Failed to update webgpu context");
}

View file

@ -534,7 +534,9 @@ impl HTMLElementMethods for HTMLElement {
}
// Step 8: If previous is a Text node, then merge with the next text node given previous.
previous.map(Self::merge_with_the_next_text_node);
if let Some(previous) = previous {
Self::merge_with_the_next_text_node(previous)
}
Ok(())
}