-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[egl] get rid of unwrap
where possible
#8024
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
Conversation
a5736e2
to
ef685ac
Compare
8a36522
to
dd86d76
Compare
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.
nice, way better. Some nits, but otherwise good to go
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.
ah, sorry one more thing: could you please add a mention in the changelog under bugfixes? thanks!
573fe50
to
d4eda9f
Compare
Co-authored-by: Andreas Reich <[email protected]>
4387f91
to
e6a83f1
Compare
Just to add a bit of context, this is fixing an |
fn instance_err<E: core::error::Error + Send + Sync + 'static>( | ||
message: impl Into<String>, | ||
) -> impl FnOnce(E) -> crate::InstanceError { | ||
move |e| crate::InstanceError::with_source(message.into(), e) | ||
} |
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.
Would be much clearer if wgpu
could define an anyhow
-like context()
trait for every Result
. That should make it a lot less likely to loose source errors with other()
, that I see a bunch of PRs do.
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.
sounds like an interseting idea, but out of scope for this pr either way
Description
This try to handle egl errors instead of panicking out. I left some unwrap and expect where no
Result
was returned.Testing
Manually tested.
Checklist
cargo fmt
.Runtaplo format
.cargo clippy --tests
. If applicable, add:--target wasm32-unknown-unknown
cargo xtask test
to run tests.If this contains user-facing changes, add aCHANGELOG.md
entry.