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(()) } diff --git a/components/webgpu/swapchain.rs b/components/webgpu/swapchain.rs index c053526738e..078ab280d3d 100644 --- a/components/webgpu/swapchain.rs +++ b/components/webgpu/swapchain.rs @@ -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");