mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
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:
parent
ad8ba49d2c
commit
0a5540f6a4
3 changed files with 9 additions and 10 deletions
|
@ -255,7 +255,7 @@ impl GPUCanvasContext {
|
||||||
.send(WebGPURequest::UpdateContext {
|
.send(WebGPURequest::UpdateContext {
|
||||||
context_id: self.context_id,
|
context_id: self.context_id,
|
||||||
size: drawing_buffer.size,
|
size: drawing_buffer.size,
|
||||||
configuration: drawing_buffer.config.clone(),
|
configuration: drawing_buffer.config,
|
||||||
})
|
})
|
||||||
.expect("Failed to update webgpu context");
|
.expect("Failed to update webgpu context");
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
// 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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -385,14 +385,11 @@ impl crate::WGPU {
|
||||||
|
|
||||||
// If configuration is not provided or presentation format is not valid
|
// If configuration is not provided or presentation format is not valid
|
||||||
// the context will be dummy until recreation
|
// the context will be dummy until recreation
|
||||||
let format = config
|
let format = config.as_ref().and_then(|config| match config.format {
|
||||||
.as_ref()
|
|
||||||
.map(|config| match config.format {
|
|
||||||
wgt::TextureFormat::Rgba8Unorm => Some(ImageFormat::RGBA8),
|
wgt::TextureFormat::Rgba8Unorm => Some(ImageFormat::RGBA8),
|
||||||
wgt::TextureFormat::Bgra8Unorm => Some(ImageFormat::BGRA8),
|
wgt::TextureFormat::Bgra8Unorm => Some(ImageFormat::BGRA8),
|
||||||
_ => None,
|
_ => None,
|
||||||
})
|
});
|
||||||
.flatten();
|
|
||||||
|
|
||||||
let needs_image_update = if let Some(format) = format {
|
let needs_image_update = if let Some(format) = format {
|
||||||
let config = config.expect("Config should exist when valid format is available");
|
let config = config.expect("Config should exist when valid format is available");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue