-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Replace unwraps with expects in bevy_pbr #4046
Conversation
Something went wrong here. You have two commits ( |
3d33632
to
5164bbe
Compare
5164bbe
to
cd070ad
Compare
I did fix it now. Sorry, this is my first pull request. |
Perfect, thanks! Don't worry about it it's all good :) |
Good stuff by the way! I'm just clarifying some of the error messages a little. :) |
Co-authored-by: Robert Swain <robert.swain@gmail.com>
Co-authored-by: Robert Swain <robert.swain@gmail.com>
Co-authored-by: Robert Swain <robert.swain@gmail.com>
Co-authored-by: Robert Swain <robert.swain@gmail.com>
Co-authored-by: Robert Swain <robert.swain@gmail.com>
Co-authored-by: Robert Swain <robert.swain@gmail.com>
Co-authored-by: Robert Swain <robert.swain@gmail.com>
Co-authored-by: Robert Swain <robert.swain@gmail.com>
Co-authored-by: Robert Swain <robert.swain@gmail.com>
Co-authored-by: Robert Swain <robert.swain@gmail.com>
Co-authored-by: Robert Swain <robert.swain@gmail.com>
Thank you for your suggestions. I did commit your suggestions except for the one about the display of primitive_topology_bits. I am not really sure how can I test it? |
I guess try |
Yes, what I actually meant was is there's a specific example or test that I can run that calls this function just to make sure that it displays correctly? |
I don’t think this should fail so I unfortunately have no suggestion how to trigger the error case. That’s why I’m suggesting just testing separately that a print or panic with a particular format string works. |
Ok , I just tested it now with load_gltf example using |
Ohhhhh, I'm sorry! |
So, now it just needs updating on top of |
What do you mean by on top of main? |
Ah you mean to update it in sync with the main branch? |
crates/bevy_pbr/src/material.rs
Outdated
let asset_server = world.get_resource::<AssetServer>().unwrap(); | ||
let render_device = world.get_resource::<RenderDevice>().unwrap(); | ||
let asset_server = world | ||
.get_resource::<AssetServer>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should replace these with the new world.resource::<AssetServer>()
methods to avoid the need for duplicate panic messages / improve ergonomics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, Shall I do it in this pull request? or should this issue be resolved independently and across all other crates as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, Shall I do it in this pull request? or should this issue be resolved independently and across all other crates as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I feel like there's no harm in merging this PR and then going through and changing get_resource()
to resource()
if that is the new(?) API to use. But it's up to @cart .
Your latest commit (merging main into your branch) went wrong. You didn't resolve the merge conflicts the right way. #4047 removed a lot of |
Yes, got it I am working on updating it to main branch now. |
Closing per discussion in #3899 <3 |
Objective
unwrap
s with eitherexpect
orunwrap_or_else
.unwrap
withexpect
#3899 .Solution
unwrap
s with more helpful error messages.