Skip to content

Remove a few unwrap #5860

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Remove a few unwrap #5860

wants to merge 1 commit into from

Conversation

oscargus
Copy link
Contributor

The aim was to do more, but most would be if let(Some(...-rewrites which I assume are not wanted.

Copy link

Preview available at https://egui-pr-preview.github.io/pr/5860-minfix
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

.unwrap()
.is_some()
{
if gl.get_extension("WEBGL_debug_renderer_info").ok().is_some() {
Copy link
Owner

Choose a reason for hiding this comment

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

This is a changes in behavior! What you want is probably something like

Suggested change
if gl.get_extension("WEBGL_debug_renderer_info").ok().is_some() {
if gl.get_extension("WEBGL_debug_renderer_info").ok().is_some_and(|ext| ext.is_some()) {

Copy link
Contributor

Choose a reason for hiding this comment

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

Could just use is_ok_and. And should maybe log the error as well, since it would be printed with unwrap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants