Consider getting rid of unwraps #186
Replies: 1 comment
-
If you're getting daily crashes those don't really sound like edge cases. I would suggest you run a debug build of satellite (just run it with I don't find blanket banning unwrap to be a meaningful use of my time. I use unwrap in cases where I don't expect something to fail, or things that I don't believe can be meaningfully recovered from. Now maybe I should be more perceptive of potential failure cases, but I generally prefer loud failure so that I can easily fix it as opposed to subtly broken behavior. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
motivation
It's come to the point where I get crashes at random edge cases that I cannot reproduce almost daily.
Perhaps it is something to consider to start getting rid of unwraps ?
Programs don't all have intermediate save state and xwayland-satellite crashing takes everything running on it down too.
Others people which I've talked to about this try to run a wayland only desktop, alas this is not a solution for everyone.
Many programs will never get wayland support and are still important for some.
Required reproduction
I've not been creating new issues for panics and unwraps since the issue template asks for reproduction steps which I cannot provide for race conditions and edge cases.
How others do it
You can use tools like clippy to enforce rules like no-panic, no-unwrap etc. Like kanidm does here: https://github.com/kanidm/kanidm/blob/4c6c0801c472264230acb9471ff40d36432f16bd/proto/src/lib.rs#L10
I don't know what Supreeeme's view on this is so I wanted to suggest and talk about it here ❤️
Beta Was this translation helpful? Give feedback.
All reactions