clippy: Fix needless_borrow warnings in components/script (#31928)

This commit is contained in:
Azhar Ismagulova 2024-03-29 08:58:22 +00:00 committed by GitHub
parent 2d5a1cd02e
commit c4739675d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 32 additions and 32 deletions

View file

@ -584,7 +584,7 @@ impl CanvasState {
}
pub fn mark_as_dirty(&self, canvas: Option<&HTMLCanvasElement>) {
if let Some(ref canvas) = canvas {
if let Some(canvas) = canvas {
canvas.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
}
}
@ -1705,7 +1705,7 @@ pub fn parse_color(canvas: Option<&HTMLCanvasElement>, string: &str) -> Result<R
// Whenever "currentColor" is used as a color in the PaintRenderingContext2D API,
// it is treated as opaque black.
None => AbsoluteColor::BLACK,
Some(ref canvas) => {
Some(canvas) => {
let canvas_element = canvas.upcast::<Element>();
match canvas_element.style() {
Some(ref s) if canvas_element.has_css_layout_box() => {