[#344] Add assert_matches#821
Conversation
|
Thank you for the PR. Couldn't we just use |
|
Approved the CI run :)
Note that it's just a dev dependency (it's useful only in tests), so it's not too bad. Also, see: #344 (comment) |
|
Do these failing code cov and doc builds need to pass? |
|
I merged #822 to fix the CI, try rebasing :) |
7dba289 to
1551088
Compare
|
I'm all for this change since it's only a dev dependency and assert_matches! is on track to end up in the How would you fee about updating the ~29 spots in the code where we use |
1551088 to
fb43622
Compare
|
Updated @danielabrozzoni @notmandatory PTAL |
|
Pushed a change to fix a linting error (seemed unrelated to my changes). |
danielabrozzoni
left a comment
There was a problem hiding this comment.
A few nits, but otherwise it's looking really good!
Can you please squash your commits together when you update?
| assert_matches!( | ||
| calc_checksum(desc).err(), | ||
| Some(DescriptorError::InvalidDescriptorChecksum) | ||
| )); | ||
| ); |
There was a problem hiding this comment.
You can drop the .err() here:
assert_matches!(
- calc_checksum(desc).err(),
- Some(DescriptorError::InvalidDescriptorChecksum)
+ calc_checksum(desc),
+ Err(DescriptorError::InvalidDescriptorChecksum)
);and same below
| Error::Signer(SignerError::NonStandardSighash) | ||
| ), | ||
| assert_matches!( | ||
| result.unwrap_err(), |
There was a problem hiding this comment.
You can avoid the unwrap_err, and match on Err(Error::Signer(SignerError::NonStandardSighash))
f6b5535 to
cb2f0ac
Compare
|
Squashed and requested changes applied. TY |
danielabrozzoni
left a comment
There was a problem hiding this comment.
There are still some instances of .err() and .unwrap_err() around, can you fix them?
cb2f0ac to
c04eb7d
Compare
|
I approved a run.. Lets see what happens.. :) |
|
Congrats.. All checks passing.. Will do a deeper review tomorrow.. |
c04eb7d to
3f3b924
Compare
Replace assert!(matches! with assert_matches! everywhere Convert assert! to assert_eq! in 2 places
3f3b924 to
14bc9c0
Compare
notmandatory
left a comment
There was a problem hiding this comment.
ACK 14bc9c0
Thanks for updating all the assert!(matches!()).
|
@rajarshimaitra if you're OK with the latest push I think you need to resolve your review changes or re-approve or just let me know and I'll go ahead with merging it. |
Since it looks like you are OK with is I have to dismiss the review so Github will let me merge.
|
Sorry I was AFK for last 3 days.. Made another pass over this and all looks good to me.. |
[#344] Add assert_matches