-
Notifications
You must be signed in to change notification settings - Fork 394
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
fix clippy::unwrap_used in re_viewer with Option::expect #8745
fix clippy::unwrap_used in re_viewer with Option::expect #8745
Conversation
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.
thank you!!
41931d1
to
e0d4ff3
Compare
a719ec0
to
fd9e54a
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.
@Wumpf I have shamelessly thrown away your cleanup work in favor of using .expect("... (internal error)")
calls (I am assuming no offense will be taken). I think this should both reduce the number of lines in most cases and clarify the code a little better.
I think this should be ready now. Please do feel free to apply any other cleanup you think may be needed & be sure to add yourself as a co-author.
crates/viewer/re_viewer/src/ui/welcome_screen/welcome_section.rs
Outdated
Show resolved
Hide resolved
a1df8c2
to
82a262c
Compare
5e7c062
to
be85177
Compare
cfa9dea
to
37fe192
Compare
I have rebased (2x), removed " |
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.
Thank you for this!
This should produce better error messages when running Rerun Wasm outside of a browser. Required because of * #8745
Related
Part of: #6330
What
crates/viewer/re_viewer/src/lib.rs
. unwrap_or_else
with panic in 1 case#[allow(clippy::unwrap_used)]
directives in limited, focused cases.expect
with descriptive messages in all other cases(no changelog updates)
General rationale:
Most of the cases using
.unwrap
seem to need these to work. I think the best solution is to use.expect
with a clear message in most of these cases.Sanity checks done:
These succeed for me with no warnings:
cargo clippy -p re_viewer --all-features
cargo build -p re_viewer --all-features
cargo fmt
does not introduce inconsistent formatting of the updated code