Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clippy fixes #2614

Merged
merged 9 commits into from Apr 6, 2018

webrender: Dereference rather than match refs.

  • Loading branch information
waywardmonkeys committed Apr 5, 2018
commit 4a587ad50e5db97875f2a321eac0822db58ef867
@@ -66,9 +66,9 @@ impl ClipRegion {
local_clip: &LocalClip,
reference_frame_relative_offset: &LayoutVector2D
) -> ClipRegion {
let complex_clips = match local_clip {
&LocalClip::Rect(_) => Vec::new(),
&LocalClip::RoundedRect(_, ref region) => vec![region.clone()],
let complex_clips = match *local_clip {
LocalClip::Rect(_) => Vec::new(),
LocalClip::RoundedRect(_, ref region) => vec![region.clone()],
};
ClipRegion::create_for_clip_node(
*local_clip.clip_rect(),
@@ -845,11 +845,11 @@ trait AddFont {

impl AddFont for FontContext {
fn add_font(&mut self, font_key: &FontKey, template: &FontTemplate) {
match template {
&FontTemplate::Raw(ref bytes, index) => {
match *template {
FontTemplate::Raw(ref bytes, index) => {
self.add_raw_font(font_key, bytes.clone(), index);
}
&FontTemplate::Native(ref native_font_handle) => {
FontTemplate::Native(ref native_font_handle) => {
self.add_native_font(font_key, (*native_font_handle).clone());
}
}
@@ -859,11 +859,11 @@ impl AddFont for FontContext {
#[cfg(feature = "pathfinder")]
impl AddFont for PathfinderFontContext {
fn add_font(&mut self, font_key: &FontKey, template: &FontTemplate) {
match template {
&FontTemplate::Raw(ref bytes, index) => {
match *template {
FontTemplate::Raw(ref bytes, index) => {
drop(self.add_font_from_memory(font_key, bytes.clone(), index));
}
&FontTemplate::Native(ref native_font_handle) => {
FontTemplate::Native(ref native_font_handle) => {
drop(self.add_native_font(font_key, (*native_font_handle).clone().0));
}
}
@@ -81,11 +81,11 @@ enum HitTestRegion {

impl HitTestRegion {
pub fn contains(&self, point: &LayerPoint) -> bool {
match self {
&HitTestRegion::Rectangle(ref rectangle) => rectangle.contains(point),
&HitTestRegion::RoundedRectangle(rect, radii, ClipMode::Clip) =>
match *self {
HitTestRegion::Rectangle(ref rectangle) => rectangle.contains(point),
HitTestRegion::RoundedRectangle(rect, radii, ClipMode::Clip) =>
rounded_rectangle_contains_point(point, &rect, &radii),
&HitTestRegion::RoundedRectangle(rect, radii, ClipMode::ClipOut) =>
HitTestRegion::RoundedRectangle(rect, radii, ClipMode::ClipOut) =>
!rounded_rectangle_contains_point(point, &rect, &radii),
}
}
@@ -94,8 +94,8 @@ impl PicturePrimitive {
pub fn resolve_scene_properties(&mut self, properties: &SceneProperties) -> bool {
match self.composite_mode {
Some(PictureCompositeMode::Filter(ref mut filter)) => {
match filter {
&mut FilterOp::Opacity(ref binding, ref mut value) => {
match *filter {
FilterOp::Opacity(ref binding, ref mut value) => {
*value = properties.resolve_float(binding, *value);
}
_ => {}
@@ -1022,8 +1022,8 @@ impl CacheTexture {
match self.bus {
CacheBus::PixelBuffer { ref mut rows, ref mut cpu_blocks, .. } => {
for update in &updates.updates {
match update {
&GpuCacheUpdate::Copy {
match *update {
GpuCacheUpdate::Copy {
block_index,
block_count,
address,
@@ -1066,8 +1066,8 @@ impl CacheTexture {
let size = self.texture.get_dimensions().to_usize();

for update in &updates.updates {
match update {
&GpuCacheUpdate::Copy {
match *update {
GpuCacheUpdate::Copy {
block_index,
block_count,
address,
@@ -412,10 +412,10 @@ impl<Src, Dst> FastTransform<Src, Dst> {

#[inline(always)]
pub fn pre_translate(&self, other_offset: &TypedVector2D<f32, Src>) -> Self {
match self {
&FastTransform::Offset(ref offset) =>
match *self {
FastTransform::Offset(ref offset) =>
FastTransform::Offset(*offset + *other_offset),
&FastTransform::Transform { transform, .. } =>
FastTransform::Transform { transform, .. } =>
FastTransform::with_transform(transform.pre_translate(other_offset.to_3d()))
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.