-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Labels
A-Cross-CuttingImpacts the entire engineImpacts the entire engineC-Code-QualityA section of code that is hard to understand or changeA section of code that is hard to understand or changeP-CrashA sudden unexpected crashA sudden unexpected crash
Description
What problem does this solve or what need does it fill?
Unwrap should generally be avoided. We already encourage contributors to avoid the use of Option::unwrap
, yet crashes from panics are still one of the most common categories of issues we're seeing now.
What solution would you like?
- Enable the clippy
unwrap_used
lint at a workspace level, and addallow-unwrap-in-tests = true
to Clippy.toml. - Replace actual expected crashes with
expect
or unwrap_or_else with a panic where possible, otherwise properly gracefully handle the error. - Preferably avoid panicking in the renderer entirely, instead failing gracefully where possible by logging a warning and not rendering anything or using blatantly obvious errors (i.e. Valve's missing texture shader).
What alternative(s) have you considered?
Leaving it as is. Keep crashing from unwraps.
Status
- bevy_animation
- bevy_app
- bevy_asset
- bevy_core_pipeline
- bevy_core_widgets
- bevy_derive
- bevy_diagnostic
- bevy_ecs
- bevy_ecs_macros
- bevy_gilrs
- bevy_gltf
- bevy_gizmos
- bevy_image
- bevy_input_focus
- bevy_light
- bevy_log
- bevy_macro_utils
- bevy_math
- bevy_mesh
- bevy_pbr
- bevy_post_process
- bevy_reflect
- bevy_reflect_derive
- bevy_render_macros
- bevy_scene
- bevy_shader
- bevy_sprite_render
- bevy_text
- bevy_transform
- bevy_ui
- bevy_ui_render
- bevy_window
- bevy_winit
ItsDoot, alice-i-cecile, bushrat011899, dmyyy, benfrankel and 14 more
Metadata
Metadata
Assignees
Labels
A-Cross-CuttingImpacts the entire engineImpacts the entire engineC-Code-QualityA section of code that is hard to understand or changeA section of code that is hard to understand or changeP-CrashA sudden unexpected crashA sudden unexpected crash