bevy/crates/bevy_render
Nicola Papale 692ef9508c
Cleanup visibility module (#9850)
# Objective

- `check_visibility` system in `bevy_render` had an
`Option<&NoFrustumCulling>` that could be replaced by `Has`, which is
theoretically faster and semantically more correct.
- It also had some awkward indenting due to very large closure argument
lists.
- Some of the tests could be written more concisely

## Solution

Use `Has`, move the tuple destructuring in a `let` binding, create a
function for the tests.

## Note to reviewers

Enable the "no white space diff" in the diff viewer to have a more
meaningful diff in the `check_visibility` system.
In the "Files changed" view, click on the little cog right of the "Jump
to" text, on the row where the "Review changes" button is. then enable
the "Hide whitespace" checkbox and click reload.

---

## Migration Guide

- The `check_visibility` system's `Option<&NoFrustumCulling>` parameter
has been replaced by `Has<NoFrustumCulling>`, if you were calling it
manually, you should change the type to match it

---------

Co-authored-by: Rob Parrett <robparrett@gmail.com>
2023-09-19 21:53:14 +00:00
..
macros Fix the clippy::explicit_iter_loop lint (#9834) 2023-09-19 03:35:22 +00:00
src Cleanup visibility module (#9850) 2023-09-19 21:53:14 +00:00
Cargo.toml Bevy Asset V2 (#8624) 2023-09-07 02:07:27 +00:00