bevy/crates/bevy_asset/src
Andrew f1f07bec09
Fix Gizmos warnings and doc errors when a subset of features are selected (#14887)
# Objective

When trying to test a gizmos change I ran `cargo test -p bevy_gizmos`
and the output had a lot of noise from warnings and failed doc errors.
This was because I didn't have all of the features enabled.

## Solution

I admit this might be pedantic, and am happy if the concensus is to
reject it. Although it does reduce the lines of code, testing noise, and
the amount of code compiled. I don't think it affects the complexity of
public code, and it doesn't change much to the complexity of internal
code.

I've removed un-needed `bevy_render` imports in all of the gizmos docs
examples, there's probably other unnecessary ones there too, but I
haven't looked exhaustively. It isn't needed for those docs, and isn't
available except in a subset of `cfg` combinations.

I've also made several of the `use` statements slightly more specific. I
shouldn't have changed the public interfaces, except that
`GizmoMeshConfig` requires either `bevy_sprite` or `bevy_pbr`, as it
does nothing without them.

I've also avoided adding some systems and plugins in situations where
they can't work. An example of this is where the `light` module depends
on `all(feature = "bevy_pbr", feature = "bevy_render")`, but it has
`use` statements that only require `bevy_render`.

## Testing

During development I ran:
```
cargo check -p bevy_gizmos && cargo check -p bevy_gizmos --features=bevy_pbr && cargo check -p bevy_gizmos --features=bevy_sprite && cargo check -p bevy_gizmos --features=bevy_render
```
Afterwards I ran this just to be sure:
```
cargo check && cargo check --features=bevy_pbr && cargo check --features=bevy_sprite && cargo check --features=bevy_render
```

Finally I ran:
```
cargo test -p bevy_gizmos && cargo test -p bevy_gizmos --features=bevy_pbr && test check -p bevy_gizmos --features=bevy_sprite && cargo test -p bevy_gizmos --features=bevy_render
```

## Migration Guide

There shouldn't be any reason to migrate, although if for some reason
you use `GizmoMeshConfig` and `bevy_render` but not `bevy_pbr` or
`bevy_sprite` (such that it does nothing), then you will get an error
that it no longer exists.
2024-08-23 16:19:06 +00:00
..
io Fix Gizmos warnings and doc errors when a subset of features are selected (#14887) 2024-08-23 16:19:06 +00:00
processor Making bevy_render an optional dependency for bevy_gizmos (#14448) 2024-08-06 13:09:10 +00:00
server Apply unused_qualifications lint (#14828) 2024-08-21 12:29:33 +00:00
assets.rs Fix rust beta lints (#14537) 2024-07-31 01:27:26 +00:00
direct_access_ext.rs Add methods to directly load assets from World (#12023) 2024-02-27 00:28:26 +00:00
event.rs Added AssetLoadFailedEvent, UntypedAssetLoadFailedEvent (#11369) 2024-01-17 21:12:00 +00:00
folder.rs Bevy Asset V2 (#8624) 2023-09-07 02:07:27 +00:00
handle.rs reflect: implement the unique reflect rfc (#7207) 2024-08-12 17:01:41 +00:00
id.rs Allow phase items not associated with meshes to be binned. (#14029) 2024-06-27 16:13:03 +00:00
lib.rs Apply unused_qualifications lint (#14828) 2024-08-21 12:29:33 +00:00
loader.rs Apply unused_qualifications lint (#14828) 2024-08-21 12:29:33 +00:00
loader_builders.rs Fix intra-doc links and make CI test them (#14076) 2024-07-11 13:08:31 +00:00
meta.rs Optimize common usages of AssetReader (#14082) 2024-07-01 19:59:42 +00:00
path.rs Generalized Into<AssetSourceId> and Into<AssetPath> Implementations over Lifetime (#10823) 2024-08-19 23:41:46 +00:00
reflect.rs reflect: implement the unique reflect rfc (#7207) 2024-08-12 17:01:41 +00:00
saver.rs Use async-fn in traits rather than BoxedFuture (#12550) 2024-03-18 17:56:57 +00:00
transformer.rs Use async-fn in traits rather than BoxedFuture (#12550) 2024-03-18 17:56:57 +00:00