bevy/crates/bevy_render/src
BD103 bc98333d7c
Fix a few Clippy lints (#11866)
# Objective

- The current implementations for `&Visibility == Visibility` and
`Visibility == &Visibility` are ambiguous, so they raise a warning for
being unconditionally recursive.
- `TaskPool`'s `LOCAL_EXECUTOR` thread local calls a `const` constructor
in a non-`const` context.

## Solution

- Make `&Visibility == Visibility` and `Visibility == &Visibility`
implementations use `Visibility == Visibility`.
- Wrap `LocalExecutor::new` in a special `const` block supported by
[`thread_local`](https://doc.rust-lang.org/stable/std/macro.thread_local.html).

---

This lints were found by running:

```shell
$ cargo clippy --workspace
```

There are a few other warnings that were more complicated, so I chose
not to include them in this PR.

<details>
  <summary>Here they are...</summary>

```shell
warning: function cannot return without recursing
  --> crates/bevy_utils/src/cow_arc.rs:92:5
   |
92 | /     fn eq(&self, other: &Self) -> bool {
93 | |         self.deref().eq(other.deref())
94 | |     }
   | |_____^
   |
note: recursive call site
  --> crates/bevy_utils/src/cow_arc.rs:93:9
   |
93 |         self.deref().eq(other.deref())
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: method `get_path` is never used
  --> crates/bevy_reflect/src/serde/de.rs:26:8
   |
25 | trait StructLikeInfo {
   |       -------------- method in this trait
26 |     fn get_path(&self) -> &str;
   |        ^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: methods `get_path` and `get_field` are never used
  --> crates/bevy_reflect/src/serde/de.rs:34:8
   |
33 | trait TupleLikeInfo {
   |       ------------- methods in this trait
34 |     fn get_path(&self) -> &str;
   |        ^^^^^^^^
35 |     fn get_field(&self, index: usize) -> Option<&UnnamedField>;
   |        ^^^^^^^^^
```

The other warnings are fixed by #11865.

</details>
2024-02-14 19:07:18 +00:00
..
batching optimize batch_and_prepare_render_phase (#11323) 2024-01-20 09:30:44 +00:00
camera CameraProjection::compute_frustum (#11139) 2024-02-04 01:21:07 +00:00
color Replace deprecated elements (#10991) 2023-12-16 02:25:12 +00:00
mesh Add Mesh::merge (#11456) 2024-02-12 22:04:33 +00:00
primitives Move EntityHash related types into bevy_ecs (#11498) 2024-02-12 15:02:24 +00:00
render_graph Multithreaded render command encoding (#9172) 2024-02-09 07:35:35 +00:00
render_phase Stop extracting mesh entities to the render world. (#11803) 2024-02-10 10:46:10 +00:00
render_resource Async pipeline compilation (#10812) 2024-02-05 13:50:50 +00:00
renderer Multithreaded render command encoding (#9172) 2024-02-09 07:35:35 +00:00
texture mipmap levels can be 0 and they should be interpreted as 1 (#11767) 2024-02-11 22:00:07 +00:00
view Fix a few Clippy lints (#11866) 2024-02-14 19:07:18 +00:00
deterministic.rs Option to enable deterministic rendering (#11248) 2024-01-09 00:46:01 +00:00
extract_component.rs Revert rendering-related associated type name changes (#11027) 2024-01-22 15:01:55 +00:00
extract_instances.rs Move EntityHash related types into bevy_ecs (#11498) 2024-02-12 15:02:24 +00:00
extract_param.rs Enable the unsafe_op_in_unsafe_fn lint (#11591) 2024-01-28 23:18:11 +00:00
extract_resource.rs Use warn_once where relevant instead of manually implementing a single warn check (#11693) 2024-02-05 21:05:43 +00:00
globals.rs Update to wgpu 0.19 and raw-window-handle 0.6 (#11280) 2024-01-26 18:14:21 +00:00
globals.wgsl Refactor Globals and View structs into separate shaders (#7512) 2023-02-11 17:55:18 +00:00
gpu_component_array_buffer.rs
lib.rs Inverse missing_docs logic (#11676) 2024-02-03 21:40:55 +00:00
maths.wgsl
pipelined_rendering.rs wait for render app when main world is dropped (#11737) 2024-02-08 14:09:17 +00:00
render_asset.rs Add ReflectKind (#11664) 2024-02-07 00:36:23 +00:00
settings.rs Update to wgpu 0.19 and raw-window-handle 0.6 (#11280) 2024-01-26 18:14:21 +00:00
spatial_bundle.rs Implement Clone for VisibilityBundle and SpatialBundle (#10394) 2023-11-07 21:25:00 +00:00