diff options
author | tanishka <109246904+taniishkaaa@users.noreply.github.com> | 2024-10-05 19:40:32 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-05 14:10:32 +0000 |
commit | 0a5540f6a49d3873a5a3c54dd0bc2336cf0b2974 (patch) | |
tree | a58b551d7a9f172f6695a71e0085c7aa16678277 /components/script | |
parent | ad8ba49d2cca9de554a9baa3c81188da91b7ec13 (diff) | |
download | servo-0a5540f6a49d3873a5a3c54dd0bc2336cf0b2974.tar.gz servo-0a5540f6a49d3873a5a3c54dd0bc2336cf0b2974.zip |
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>
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/gpucanvascontext.rs | 2 | ||||
-rw-r--r-- | components/script/dom/htmlelement.rs | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/components/script/dom/gpucanvascontext.rs b/components/script/dom/gpucanvascontext.rs index fbf07f74c23..618cc885229 100644 --- a/components/script/dom/gpucanvascontext.rs +++ b/components/script/dom/gpucanvascontext.rs @@ -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"); } diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs index 76bb021ea21..84807a3cbcb 100644 --- a/components/script/dom/htmlelement.rs +++ b/components/script/dom/htmlelement.rs @@ -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(()) } |