-
Notifications
You must be signed in to change notification settings - Fork 19
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
Simplify matches #1490
Simplify matches #1490
Conversation
| Message::Unknown(..) => None, | ||
|
||
Message::ExtentError { error, .. } | ||
| Message::ErrorReport { error, .. } => Some(error), | ||
|
||
Message::ExtentLiveCloseAck { result, .. } => result.as_ref().err(), |
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.
I don't know if this makes it any simpler, but I also don't really care one way or the other. I do think it's all part of your master plan to touch every line in Crucible :)
However, you should be able to put Message::ExtentLiveCloseAck
with the rest just below, right?
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.
I don't know if this makes it any simpler, but I also don't really care one way or the other. I do think it's all part of your master plan to touch every line in Crucible :)
🤫
However, you should be able to put
Message::ExtentLiveCloseAck
with the rest just below, right?
They're actually different types Result<(), CrucibleError>
versus Result<(u64, u64, bool), CrucibleError>
, so you can't match on them simultaneously (even though we're only using the error).
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.
same question as Alan, otherwise 🚀
ca676f0
to
4217290
Compare
8d4ace2
to
8ff3d11
Compare
8ff3d11
to
f50bfd9
Compare
(Staged on top of #1489)
Drive-by cleanup to simplify match statements:
..
instead offoobar: _
to ignore fieldsmatch
statement with identical branches(I don't think we're ever deliberately destructuring objects to check their shape, but let me know if that's an incorrect assumption!)