Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Change From<Icosphere> to TryFrom<Icosphere> #6484

Closed
wants to merge 3 commits into from

Conversation

2ne1ugly
Copy link
Contributor

@2ne1ugly 2ne1ugly commented Nov 5, 2022

Objective

Solution

  • Return error instead of panic through TryFrom
  • Add .except() in examples
  • Add .unwrap() in examples

Copy link
Contributor

@TimJentzsch TimJentzsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me!

@alice-i-cecile alice-i-cecile added the C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide label Nov 5, 2022
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great new error type!

The .expects should be replaced by .unwrap: the error returned will be better than a simple string and it's easier to maintain and read.

examples/ecs/iter_combinations.rs Outdated Show resolved Hide resolved
@alice-i-cecile alice-i-cecile added C-Usability A simple quality-of-life change that makes Bevy easier to use A-Rendering Drawing game state to the screen labels Nov 5, 2022
@2ne1ugly 2ne1ugly changed the title Change From<Icosphere> to TryFrom<Icosphere> Change From<Icosphere> to TryFrom<Icosphere> Nov 5, 2022
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Nov 5, 2022
@cart
Copy link
Member

cart commented Nov 14, 2022

bors r+

bors bot pushed a commit that referenced this pull request Nov 14, 2022
# Objective

- Fixes  #6476

## Solution

- Return error instead of panic through `TryFrom`
- ~~Add `.except()` in examples~~ 
- Add `.unwrap()` in examples
@bors bors bot changed the title Change From<Icosphere> to TryFrom<Icosphere> [Merged by Bors] - Change From<Icosphere> to TryFrom<Icosphere> Nov 14, 2022
@bors bors bot closed this Nov 14, 2022
taiyoungjang pushed a commit to taiyoungjang/bevy that referenced this pull request Dec 15, 2022
# Objective

- Fixes  bevyengine#6476

## Solution

- Return error instead of panic through `TryFrom`
- ~~Add `.except()` in examples~~ 
- Add `.unwrap()` in examples
@2ne1ugly 2ne1ugly deleted the try-from-icosphere branch January 8, 2023 06:33
alradish pushed a commit to alradish/bevy that referenced this pull request Jan 22, 2023
# Objective

- Fixes  bevyengine#6476

## Solution

- Return error instead of panic through `TryFrom`
- ~~Add `.except()` in examples~~ 
- Add `.unwrap()` in examples
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

- Fixes  bevyengine#6476

## Solution

- Return error instead of panic through `TryFrom`
- ~~Add `.except()` in examples~~ 
- Add `.unwrap()` in examples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide C-Usability A simple quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clippy::fallible-impl-from for From<Icosphere> for Mesh
6 participants