bevy/examples/shader
Torstein Grindvik daa57fe489 Add try_* to add_slot_edge, add_node_edge (#6720)
# Objective

`add_node_edge` and `add_slot_edge` are fallible methods, but are always used with `.unwrap()`.
`input_node` is often unwrapped as well.
This points to having an infallible behaviour as default, with an alternative fallible variant if needed.

Improves readability and ergonomics.

## Solution

- Change `add_node_edge` and `add_slot_edge` to panic on error.
- Change `input_node` to panic on `None`.
- Add `try_add_node_edge` and `try_add_slot_edge` in case fallible methods are needed.
- Add `get_input_node` to still be able to get an `Option`.
---

## Changelog

### Added

- `try_add_node_edge`
- `try_add_slot_edge`
- `get_input_node`

### Changed

- `add_node_edge` is now infallible (panics on error)
- `add_slot_edge` is now infallible (panics on error)
- `input_node` now panics on `None`

## Migration Guide

Remove `.unwrap()` from `add_node_edge` and `add_slot_edge`.
For cases where the error was handled, use `try_add_node_edge` and `try_add_slot_edge` instead.

Remove `.unwrap()` from `input_node`.
For cases where the option was handled, use `get_input_node` instead.


Co-authored-by: Torstein Grindvik <52322338+torsteingrindvik@users.noreply.github.com>
2022-11-21 21:58:39 +00:00
..
animate_shader.rs add globals to mesh view bind group (#5409) 2022-09-28 04:20:27 +00:00
array_texture.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
compute_shader_game_of_life.rs Add try_* to add_slot_edge, add_node_edge (#6720) 2022-11-21 21:58:39 +00:00
custom_vertex_attribute.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
post_processing.rs Update post_processing example to not render UI with first pass camera (#6469) 2022-11-14 22:34:26 +00:00
shader_defs.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
shader_instancing.rs ExtractComponent output optional associated type (#6699) 2022-11-21 13:19:44 +00:00
shader_material.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
shader_material_glsl.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
shader_material_screenspace_texture.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00