Adds a `default()` shorthand for `Default::default()` ... because life is too short to constantly type `Default::default()`.
```rust
use bevy::prelude::*;
#[derive(Default)]
struct Foo {
bar: usize,
baz: usize,
}
// Normally you would do this:
let foo = Foo {
bar: 10,
..Default::default()
};
// But now you can do this:
let foo = Foo {
bar: 10,
..default()
};
```
The examples have been adapted to use `..default()`. I've left internal crates as-is for now because they don't pull in the bevy prelude, and the ergonomics of each case should be considered individually.
12 lines
242 B
Rust
12 lines
242 B
Rust
use bevy::{prelude::*, render::settings::WgpuSettings};
|
|
|
|
fn main() {
|
|
App::new()
|
|
.insert_resource(WgpuSettings {
|
|
backends: None,
|
|
..default()
|
|
})
|
|
.add_plugins(DefaultPlugins)
|
|
.run();
|
|
}
|