bevy/crates/bevy_app/src
Ben Frankel 7cb97852a5
Remove second generic from .add_before, .add_after (#14285)
# Objective

```rust
// Currently:
builder.add_after::<FooPlugin, _>(BarPlugin);
// After this PR:
builder.add_after::<FooPlugin>(BarPlugin);
```

This removes some weirdness and better parallels the rest of the
`PluginGroupBuilder` API.

## Solution

Define a helper method `type_id_of_val` to use in `.add_before` and
`.add_after` instead of `TypeId::of::<T>` (which requires the plugin
type to be nameable, preventing `impl Plugin` from being used).

## Testing

Ran `cargo run -p ci lints` successfully.

## Migration Guide

Removed second generic from `PluginGroupBuilder` methods: `add_before`
and `add_after`.

```rust
// Before:
DefaultPlugins
    .build()
    .add_before::<WindowPlugin, _>(FooPlugin)
    .add_after::<WindowPlugin, _>(BarPlugin)

// After:
DefaultPlugins
    .build()
    .add_before::<WindowPlugin>(FooPlugin)
    .add_after::<WindowPlugin>(BarPlugin)
```

---------

Co-authored-by: BD103 <59022059+BD103@users.noreply.github.com>
2024-07-15 15:58:14 +00:00
..
app.rs Fix intra-doc links and make CI test them (#14076) 2024-07-11 13:08:31 +00:00
lib.rs Handle Ctrl+C in the terminal properly (#14001) 2024-07-01 14:08:42 +00:00
main_schedule.rs Fix intra-doc links and make CI test them (#14076) 2024-07-11 13:08:31 +00:00
panic_handler.rs Fix lints introduced in Rust beta 1.80 (#13899) 2024-06-17 17:22:01 +00:00
plugin_group.rs Remove second generic from .add_before, .add_after (#14285) 2024-07-15 15:58:14 +00:00
plugin.rs Add on_unimplemented Diagnostics to Most Public Traits (#13347) (#13662) 2024-06-04 00:31:34 +00:00
schedule_runner.rs Simplify runner app exit code. (#13074) 2024-04-23 20:42:00 +00:00
sub_app.rs feat(bevy_app): expose an API to perform updates for a specific sub-app. (#14009) 2024-06-25 14:04:31 +00:00
terminal_ctrl_c_handler.rs Handle Ctrl+C in the terminal properly (#14001) 2024-07-01 14:08:42 +00:00