mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
51a5070cd2
# 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. |
||
---|---|---|
.. | ||
contributors.rs | ||
many_sprites.rs | ||
mesh.rs | ||
sprite.rs | ||
sprite_flipping.rs | ||
sprite_sheet.rs | ||
text2d.rs | ||
texture_atlas.rs |