Skip to content

Commit 115f158

Browse files
committed
chore: Fix needless_borrow clippy lints
Though rust-lang/rust-clippy#8355 has been merged, it seems to still report false-positives on nightly channel. For now just fix the instances reported by stable clippy, and keep `needless_borrow` allowed.
1 parent 7fa35f2 commit 115f158

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

core/src/avm1/value.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl<'gc> Value<'gc> {
150150
Value::Bool(true) => 1.0,
151151
Value::Number(v) => *v,
152152
Value::Object(_) => f64::NAN,
153-
Value::String(v) => string_to_f64(&v, activation.swf_version()),
153+
Value::String(v) => string_to_f64(v, activation.swf_version()),
154154
}
155155
}
156156

@@ -424,7 +424,7 @@ impl<'gc> Value<'gc> {
424424
if swf_version >= 7 {
425425
!v.is_empty()
426426
} else {
427-
let num = string_to_f64(&v, swf_version);
427+
let num = string_to_f64(v, swf_version);
428428
!num.is_nan() && num != 0.0
429429
}
430430
}

core/src/avm2/property.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl<'gc> PropertyClass<'gc> {
7070
PropertyClass::Class(class) => Some(*class),
7171
PropertyClass::Name(gc) => {
7272
let (name, unit) = &**gc;
73-
let class = resolve_class_private(&name, *unit, activation)?;
73+
let class = resolve_class_private(name, *unit, activation)?;
7474
*self = match class {
7575
Some(class) => PropertyClass::Class(class),
7676
None => PropertyClass::Any,

render/canvas/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ impl RenderBackend for WebCanvasRenderBackend {
397397
);
398398
}
399399
CanvasFillStyle::Gradient(gradient) => {
400-
self.set_color_filter(&transform);
400+
self.set_color_filter(transform);
401401
self.context.set_fill_style(gradient);
402402
self.context.fill_with_path_2d_and_winding(
403403
path,
@@ -409,7 +409,7 @@ impl RenderBackend for WebCanvasRenderBackend {
409409
// Canvas has no easy way to draw gradients with an arbitrary transform,
410410
// but we can fake it by pushing the gradient's transform to the canvas,
411411
// then transforming the path itself by the inverse.
412-
self.set_color_filter(&transform);
412+
self.set_color_filter(transform);
413413
self.context.set_fill_style(&gradient.gradient);
414414
let matrix = &gradient.gradient_matrix;
415415
self.context
@@ -440,7 +440,7 @@ impl RenderBackend for WebCanvasRenderBackend {
440440
self.clear_color_filter();
441441
}
442442
CanvasFillStyle::Pattern(patt, smoothed) => {
443-
self.set_color_filter(&transform);
443+
self.set_color_filter(transform);
444444
self.context.set_image_smoothing_enabled(*smoothed);
445445
self.context.set_fill_style(patt);
446446
self.context.fill_with_path_2d_and_winding(
@@ -470,13 +470,13 @@ impl RenderBackend for WebCanvasRenderBackend {
470470
self.context.stroke_with_path(path);
471471
}
472472
CanvasFillStyle::Gradient(gradient) => {
473-
self.set_color_filter(&transform);
473+
self.set_color_filter(transform);
474474
self.context.set_stroke_style(gradient);
475475
self.context.stroke_with_path(path);
476476
self.clear_color_filter();
477477
}
478478
CanvasFillStyle::TransformedGradient(gradient) => {
479-
self.set_color_filter(&transform);
479+
self.set_color_filter(transform);
480480
self.context.set_stroke_style(&gradient.gradient);
481481
self.context.stroke_with_path(path);
482482
self.context
@@ -573,7 +573,7 @@ impl RenderBackend for WebCanvasRenderBackend {
573573
// A possible improvement is to choose the winding rule based on whether the shape has
574574
// layers or not (via a flag in DistilledShape?)
575575
self.context
576-
.clip_with_path_2d_and_winding(&mask_path, CanvasWindingRule::Nonzero);
576+
.clip_with_path_2d_and_winding(mask_path, CanvasWindingRule::Nonzero);
577577
self.mask_state = MaskState::DrawContent;
578578
}
579579
}

render/common_tess/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl ShapeTessellator {
4747
is_closed,
4848
} => (
4949
style.fill_style(),
50-
ruffle_path_to_lyon_path(&commands, *is_closed),
50+
ruffle_path_to_lyon_path(commands, *is_closed),
5151
true,
5252
),
5353
};

render/wgpu/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ impl<T: RenderTarget + 'static> RenderBackend for WgpuRenderBackend<T> {
12591259

12601260
let mut render_pass = copy_encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
12611261
color_attachments: &[Some(wgpu::RenderPassColorAttachment {
1262-
view: &frame.frame_data.1.view(),
1262+
view: frame.frame_data.1.view(),
12631263
ops: wgpu::Operations {
12641264
load: wgpu::LoadOp::Clear(wgpu::Color::TRANSPARENT),
12651265
store: true,

0 commit comments

Comments
 (0)