bevy/crates/bevy_core_pipeline/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
..
auto_exposure Fix lints introduced in Rust beta 1.80 (#13899) 2024-06-17 17:22:01 +00:00
blit Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
bloom Fix a few "repeated word" typos (#13955) 2024-06-20 21:35:20 +00:00
contrast_adaptive_sharpening Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
core_2d Implement subpixel morphological antialiasing, or SMAA. (#13423) 2024-06-04 17:07:34 +00:00
core_3d Fix compile failure in WASM without wgpu backend (#14081) 2024-06-30 22:58:43 +00:00
deferred Allow phase items not associated with meshes to be binned. (#14029) 2024-06-27 16:13:03 +00:00
dof Implement opt-in sharp screen-space reflections for the deferred renderer, with improved raymarching code. (#13418) 2024-05-27 13:43:40 +00:00
fullscreen_vertex_shader
fxaa Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
motion_blur Fix: Motion blur should sample onscreen fragments with no depth (#13573) 2024-05-30 13:52:47 +00:00
prepass Allow phase items not associated with meshes to be binned. (#14029) 2024-06-27 16:13:03 +00:00
skybox Apply Clippy lints regarding lazy evaluation and closures (#14015) 2024-07-01 15:54:40 +00:00
smaa don't crash without features bevy_pbr, ktx2, zstd (#14020) 2024-06-26 03:08:23 +00:00
taa Implement motion vectors and TAA for skinned meshes and meshes with morph targets. (#13572) 2024-05-31 17:02:28 +00:00
tonemapping Skip tonemapping in case it is none (#13679) 2024-06-05 11:32:46 +00:00
upscaling Apply Clippy lints regarding lazy evaluation and closures (#14015) 2024-07-01 15:54:40 +00:00
lib.rs Implement subpixel morphological antialiasing, or SMAA. (#13423) 2024-06-04 17:07:34 +00:00
msaa_writeback.rs Clean up 2d render phases (#12982) 2024-05-08 08:13:39 +00:00