bevy/examples/2d
Charles Giguere 51a5070cd2 add get_single variant (#2793)
# Objective

The vast majority of `.single()` usage I've seen is immediately followed by a `.unwrap()`. Since it seems most people use it without handling the error, I think making it easier to just get what you want fast while also having a more verbose alternative when you want to handle the error could help.

## Solution

Instead of having a lot of `.unwrap()` everywhere, this PR introduces a `try_single()` variant that behaves like the current `.single()` and make the new `.single()` panic on error.
2021-09-10 20:23:50 +00:00
..
contributors.rs Merge AppBuilder into App (#2531) 2021-07-27 20:21:06 +00:00
many_sprites.rs add get_single variant (#2793) 2021-09-10 20:23:50 +00:00
mesh.rs Merge AppBuilder into App (#2531) 2021-07-27 20:21:06 +00:00
sprite.rs Merge AppBuilder into App (#2531) 2021-07-27 20:21:06 +00:00
sprite_flipping.rs Merge AppBuilder into App (#2531) 2021-07-27 20:21:06 +00:00
sprite_sheet.rs Merge AppBuilder into App (#2531) 2021-07-27 20:21:06 +00:00
text2d.rs Merge AppBuilder into App (#2531) 2021-07-27 20:21:06 +00:00
texture_atlas.rs Merge AppBuilder into App (#2531) 2021-07-27 20:21:06 +00:00