bevy/examples/2d
Carter Anderson b6a647cc01 default() shorthand (#4071)
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.
2022-03-01 20:52:09 +00:00
..
contributors.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
many_sprites.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
mesh2d.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
mesh2d_manual.rs Make get_resource (and friends) infallible (#4047) 2022-02-27 22:37:18 +00:00
move_sprite.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
rect.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
rotation.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
sprite.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
sprite_flipping.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
sprite_sheet.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
text2d.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
texture_atlas.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00