mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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
|
@ -385,14 +385,11 @@ impl crate::WGPU {
|
|||
|
||||
// If configuration is not provided or presentation format is not valid
|
||||
// the context will be dummy until recreation
|
||||
let format = config
|
||||
.as_ref()
|
||||
.map(|config| match config.format {
|
||||
wgt::TextureFormat::Rgba8Unorm => Some(ImageFormat::RGBA8),
|
||||
wgt::TextureFormat::Bgra8Unorm => Some(ImageFormat::BGRA8),
|
||||
_ => None,
|
||||
})
|
||||
.flatten();
|
||||
let format = config.as_ref().and_then(|config| match config.format {
|
||||
wgt::TextureFormat::Rgba8Unorm => Some(ImageFormat::RGBA8),
|
||||
wgt::TextureFormat::Bgra8Unorm => Some(ImageFormat::BGRA8),
|
||||
_ => None,
|
||||
});
|
||||
|
||||
let needs_image_update = if let Some(format) = format {
|
||||
let config = config.expect("Config should exist when valid format is available");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue