bevy/crates/bevy_pbr/src
Lura 856b39d821
Apply Clippy lints regarding lazy evaluation and closures (#14015)
# Objective

- Lazily evaluate
[default](https://rust-lang.github.io/rust-clippy/master/index.html#/unwrap_or_default)~~/[or](https://rust-lang.github.io/rust-clippy/master/index.html#/or_fun_call)~~
values where it makes sense
  - ~~`unwrap_or(foo())` -> `unwrap_or_else(|| foo())`~~
  - `unwrap_or(Default::default())` -> `unwrap_or_default()`
  - etc.
- Avoid creating [redundant
closures](https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_closure),
even for [method
calls](https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_closure_for_method_calls)
  - `map(|something| something.into())` -> `map(Into:into)`

## Solution

- Apply Clippy lints:
-
~~[or_fun_call](https://rust-lang.github.io/rust-clippy/master/index.html#/or_fun_call)~~
-
[unwrap_or_default](https://rust-lang.github.io/rust-clippy/master/index.html#/unwrap_or_default)
-
[redundant_closure_for_method_calls](https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_closure_for_method_calls)
([redundant
closures](https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_closure)
is already enabled)

## Testing

- Tested on Windows 11 (`stable-x86_64-pc-windows-gnu`, 1.79.0)
- Bevy compiles without errors or warnings and examples seem to work as
intended
  - `cargo clippy` 
  - `cargo run -p ci -- compile` 

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2024-07-01 15:54:40 +00:00
..
cluster Rename "point light" to "clusterable object" in cluster contexts. (#13654) 2024-06-04 11:01:13 +00:00
deferred Revert "Make FOG_ENABLED a shader_def instead of material flag (#13783)" (#13803) 2024-06-10 23:25:16 +00:00
light Apply Clippy lints regarding lazy evaluation and closures (#14015) 2024-07-01 15:54:40 +00:00
light_probe Apply Clippy lints regarding lazy evaluation and closures (#14015) 2024-07-01 15:54:40 +00:00
lightmap Generate MeshUniforms on the GPU via compute shader where available. (#12773) 2024-04-10 05:33:32 +00:00
meshlet Fix incorrect computation of mips for cluster occlusion lookup (#14042) 2024-06-27 05:57:01 +00:00
prepass Allow phase items not associated with meshes to be binned. (#14029) 2024-06-27 16:13:03 +00:00
render don't put previous skin/morph in the morphed_skinned_mesh_layout (#14065) 2024-06-29 01:03:51 +00:00
ssao Normalise matrix naming (#13489) 2024-06-03 16:56:53 +00:00
ssr Implement opt-in sharp screen-space reflections for the deferred renderer, with improved raymarching code. (#13418) 2024-05-27 13:43:40 +00:00
volumetric_fog Adds back in way to convert color to u8 array, implemented for the two RGB color types, also renames Color::linear to Color::to_linear. (#13759) 2024-06-10 13:03:46 +00:00
bundle.rs Implement clone for most bundles. (#12993) 2024-04-16 16:37:09 +00:00
extended_material.rs Add missing Default impl to ExtendedMaterial. (#13008) 2024-04-18 12:57:14 +00:00
fog.rs Fix lints introduced in Rust beta 1.80 (#13899) 2024-06-17 17:22:01 +00:00
lib.rs Refactor check_light_mesh_visibility for performance #1 (#13905) 2024-06-18 03:22:54 +00:00
material.rs Allow phase items not associated with meshes to be binned. (#14029) 2024-06-27 16:13:03 +00:00
parallax.rs bevy_reflect: FromReflect Ergonomics Implementation (#6056) 2023-06-29 01:31:34 +00:00
pbr_material.rs Apply Clippy lints regarding lazy evaluation and closures (#14015) 2024-07-01 15:54:40 +00:00
wireframe.rs Use WireframeColor to override global color (#13034) 2024-04-20 13:59:12 +00:00