Bug 1607697 - Miscellaneous clippy lint fixes. r=Gankro

Differential Revision: https://phabricator.services.mozilla.com/D59118

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nicolas Silva 2020-01-08 15:41:42 +00:00
Родитель bfa259e505
Коммит 9e26acd416
9 изменённых файлов: 24 добавлений и 30 удалений

Просмотреть файл

@ -165,7 +165,7 @@ fn push_component_transfer_data(
request: &mut GpuDataRequest,
) {
match func_comp {
SFilterDataComponent::Identity => { return; }
SFilterDataComponent::Identity => {}
SFilterDataComponent::Table(values) |
SFilterDataComponent::Discrete(values) => {
// Push a 256 entry lookup table.

Просмотреть файл

@ -1350,7 +1350,7 @@ impl DirtyRegion {
/// Creates a record of this dirty region for exporting to test infrastructure.
pub fn record(&self) -> RecordedDirtyRegion {
let mut rects: Vec<WorldRect> =
self.dirty_rects.iter().map(|r| r.world_rect.clone()).collect();
self.dirty_rects.iter().map(|r| r.world_rect).collect();
rects.sort_unstable_by_key(|r| (r.origin.y as usize, r.origin.x as usize));
RecordedDirtyRegion { rects }
}
@ -5105,7 +5105,7 @@ impl TileNode {
.collect();
self.kind = TileNodeKind::Node {
children: children,
children,
};
}
Some(TileModification::Merge) => {

Просмотреть файл

@ -365,7 +365,7 @@ impl FontContext {
}
pub fn delete_font(&mut self, font_key: &FontKey) {
if let Some(_) = self.faces.remove(font_key) {
if self.faces.remove(font_key).is_some() {
self.variations.retain(|k, _| k.0 != *font_key);
}
}

Просмотреть файл

@ -253,7 +253,7 @@ impl FontContext {
let b = pixel[2];
print!("({}, {}, {}) ", r, g, b,);
}
println!("");
println!();
}
}

Просмотреть файл

@ -958,12 +958,12 @@ impl ProfileGraph {
for value in &self.values {
stats.min_value = stats.min_value.min(*value);
stats.mean_value = stats.mean_value + *value;
stats.mean_value += *value;
stats.max_value = stats.max_value.max(*value);
}
if !self.values.is_empty() {
stats.mean_value = stats.mean_value / self.values.len() as f32;
stats.mean_value /= self.values.len() as f32;
}
stats

Просмотреть файл

@ -3366,7 +3366,7 @@ impl Renderer {
let mut upload_time = TimeProfileCounter::new("GPU cache upload time", false, Some(0.0..2.0));
let updated_rows = upload_time.profile(|| {
return self.gpu_cache_texture.flush(&mut self.device);
self.gpu_cache_texture.flush(&mut self.device)
});
self.gpu_cache_upload_time += upload_time.get();
@ -4566,7 +4566,7 @@ impl Renderer {
let _gm2 = self.gpu_profile.start_marker("box-shadows");
let textures = BatchTextures {
colors: [
mask_texture_id.clone(),
*mask_texture_id,
TextureSource::Invalid,
TextureSource::Invalid,
],
@ -4586,7 +4586,7 @@ impl Renderer {
let _gm2 = self.gpu_profile.start_marker("clip images");
let textures = BatchTextures {
colors: [
mask_texture_id.clone(),
*mask_texture_id,
TextureSource::Invalid,
TextureSource::Invalid,
],
@ -5496,7 +5496,7 @@ impl Renderer {
self.device.enable_pixel_local_storage(false);
}
pub fn debug_renderer<'b>(&'b mut self) -> Option<&'b mut DebugRenderer> {
pub fn debug_renderer(&mut self) -> Option<&mut DebugRenderer> {
self.debug.get_mut(&mut self.device)
}
@ -5838,7 +5838,7 @@ impl Renderer {
let margin = 10.0;
debug_renderer.add_quad(
&x0 - margin,
x0 - margin,
y0 - margin,
x0 + text_width + margin,
y + margin,
@ -6761,9 +6761,7 @@ impl Renderer {
}
}
fn get_vao<'a>(vertex_array_kind: VertexArrayKind,
vaos: &'a RendererVAOs)
-> &'a VAO {
fn get_vao(vertex_array_kind: VertexArrayKind, vaos: &RendererVAOs) -> &VAO {
match vertex_array_kind {
VertexArrayKind::Primitive => &vaos.prim_vao,
VertexArrayKind::Clip => &vaos.clip_vao,

Просмотреть файл

@ -518,7 +518,7 @@ impl SceneBuilderThread {
/// Do the bulk of the work of the scene builder thread.
fn process_transaction(&mut self, txn: &mut Transaction) -> Box<BuiltTransaction> {
if let &Some(ref hooks) = &self.hooks {
if let Some(ref hooks) = self.hooks {
hooks.pre_scene_build();
}
@ -612,8 +612,8 @@ impl SceneBuilderThread {
/// Send the results of process_transaction back to the render backend.
fn forward_built_transactions(&mut self, txns: Vec<Box<BuiltTransaction>>) {
let (pipeline_info, result_tx, result_rx) = match &self.hooks {
&Some(ref hooks) => {
let (pipeline_info, result_tx, result_rx) = match self.hooks {
Some(ref hooks) => {
if txns.iter().any(|txn| txn.built_scene.is_some()) {
let info = PipelineInfo {
epochs: txns.iter()
@ -646,7 +646,7 @@ impl SceneBuilderThread {
let have_resources_updates : Vec<DocumentId> = if pipeline_info.is_none() {
txns.iter()
.filter(|txn| !txn.resource_updates.is_empty() || txn.invalidate_rendered_frame)
.map(|txn| txn.document_id.clone())
.map(|txn| txn.document_id)
.collect()
} else {
Vec::new()
@ -663,14 +663,11 @@ impl SceneBuilderThread {
self.hooks.as_ref().unwrap().post_scene_swap(&document_ids,
pipeline_info, scene_swap_time);
// Once the hook is done, allow the RB thread to resume
match swap_result {
Ok(SceneSwapResult::Complete(resume_tx)) => {
resume_tx.send(()).ok();
},
_ => (),
};
if let Ok(SceneSwapResult::Complete(resume_tx)) = swap_result {
resume_tx.send(()).ok();
}
} else if !have_resources_updates.is_empty() {
if let &Some(ref hooks) = &self.hooks {
if let Some(ref hooks) = self.hooks {
hooks.post_resource_update(&have_resources_updates);
}
} else if let Some(ref hooks) = self.hooks {

Просмотреть файл

@ -727,7 +727,7 @@ impl<'a> SceneBuilder<'a> {
((stats.num_bytes as f32 / total_bytes.max(1) as f32) * 100.0) as usize,
stats.num_bytes / stats.total_count.max(1));
}
println!("");
println!();
}
}
@ -3740,7 +3740,7 @@ impl FlattenedStackingContext {
// We can skip mix-blend modes if they are the first primitive in a stacking context,
// see pop_stacking_context for a full explanation.
if !self.composite_ops.mix_blend_mode.is_none() &&
if self.composite_ops.mix_blend_mode.is_some() &&
!parent.prim_list.is_empty() {
return false;
}
@ -3953,7 +3953,7 @@ fn filter_primitives_for_compositing(
// TODO(gw): Now that we resolve these later on,
// we could probably make it a bit
// more efficient than cloning these here.
input_filter_primitives.iter().map(|primitive| primitive.into()).collect()
input_filter_primitives.iter().map(|primitive| primitive).collect()
}
fn process_repeat_size(

Просмотреть файл

@ -300,7 +300,6 @@ impl SpatialNode {
match self.node_type {
SpatialNodeType::ReferenceFrame(info) if !info.invertible => {
self.mark_uninvertible(state);
return;
}
_ => self.invertible = true,
}