-
Notifications
You must be signed in to change notification settings - Fork 65
implemented assert! for resolving warning panic! #227
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #227 +/- ##
=======================================
Coverage 58.61% 58.61%
=======================================
Files 30 30
Lines 3542 3542
Branches 785 785
=======================================
Hits 2076 2076
Misses 1170 1170
Partials 296 296
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
you should follow the recommendation: |
tertsdiepraam
left a comment
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.
Nice! I think we can clean up just a bit more than what clippy suggests by removing the double negation.
src/find/matchers/name.rs
Outdated
| panic!("Failed to create sym link: {:?}", e); | ||
| } | ||
| assert!( | ||
| !(e.kind() != ErrorKind::AlreadyExists), |
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.
There's a double negation here now that can be removed:
| !(e.kind() != ErrorKind::AlreadyExists), | |
| e.kind() == ErrorKind::AlreadyExists, |
Clippy probably would suggest the same thing.
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.
implementing it
warning: only a 'panic!' in 'if'-then statement #226
Used assert! statement instead of alert, to indicate a failed condition without stopping the program immediately.