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

Address some issues found by rust-clippy. #202

Merged
merged 4 commits into from Feb 26, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Avoid explicit calls to 'iter' and 'iter_mut'.

  • Loading branch information
frewsxcv committed Feb 26, 2016
commit 1f41f5c1134fe25e8eeaefc3827314366bcec58c
@@ -514,7 +514,7 @@ impl StackingContextHelpers for StackingContext {
if self.needs_composition_operation_for_mix_blend_mode() {
composition_operations.push(CompositionOp::MixBlend(self.mix_blend_mode));
}
for filter in self.filters.iter() {
for filter in &self.filters {
match *filter {
FilterOp::Blur(radius) => {
composition_operations.push(CompositionOp::Filter(LowLevelFilterOp::Blur(
@@ -894,7 +894,7 @@ impl Renderer {
f: F)
where F: Fn(&Rect<f32>) -> [PackedVertexForTextureCacheUpdate; 4] {
// FIXME(pcwalton): Use a hash table if this linear search shows up in the profile.
for batch in self.raster_batches.iter_mut() {
for batch in &mut self.raster_batches {
if batch.add_rect_if_possible(dest_texture_id,
color_texture_id,
program_id,
@@ -94,7 +94,7 @@ impl<K,V> ResourceClassCache<K,V> where K: Clone + Hash + Eq + Debug, V: Resourc

fn expire_old_resources(&mut self, texture_cache: &mut TextureCache, frame_id: FrameId) {
let mut resources_to_destroy = vec![];
for (key, this_frame_id) in self.last_access_times.iter() {
for (key, this_frame_id) in &self.last_access_times {
if *this_frame_id < frame_id {
resources_to_destroy.push((*key).clone())
}
@@ -160,7 +160,7 @@ impl BuildRequiredResources for AABBTreeNode {
let display_item = &draw_list.items[index as usize];

// Handle border radius for complex clipping regions.
for complex_clip_region in display_item.clip.complex.iter() {
for complex_clip_region in &display_item.clip.complex {
resource_list.add_radius_raster_for_border_radii(&complex_clip_region.radii);
}

@@ -822,7 +822,7 @@ impl TextureCache {
}
}

for update in self.pending_updates.updates.iter_mut() {
for update in &mut self.pending_updates.updates {
if update.id == old_texture_id {
update.id = new_texture_id
}
@@ -49,7 +49,7 @@ impl MatrixHelpers for Matrix4 {
let bottom_right = self.transform_point(&rect.bottom_right());
let (mut min_x, mut min_y) = (top_left.x.clone(), top_left.y.clone());
let (mut max_x, mut max_y) = (min_x.clone(), min_y.clone());
for point in [ top_right, bottom_left, bottom_right ].iter() {
for point in &[ top_right, bottom_left, bottom_right ] {
if point.x < min_x {
min_x = point.x.clone()
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.