-
Notifications
You must be signed in to change notification settings - Fork 152
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
Avoid some warnings from Clippy #299
base: master
Are you sure you want to change the base?
Avoid some warnings from Clippy #299
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.
See #284 for alternative changes for the non_fmt_panic
-bits. This is not to say that they can't/shouldn't be included here (too).
@@ -162,7 +162,7 @@ impl QuickCheck { | |||
|
|||
let n_tests_passed = match self.quicktest(f) { | |||
Ok(n_tests_passed) => n_tests_passed, | |||
Err(result) => panic!(result.failed_msg()), | |||
Err(result) => panic!("{}", result.failed_msg()), |
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.
Hmmm I don't think this is right... What's the motivation for this change?
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.
Like with write!
, print!
or good old printf
, passing dynamic string-data as format string (panic!
can format messages for some time now) is frowned upon. Current versions of rust will report a warning during compilation for this line, and probably an error in the future.
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.
Ah I see. Gotya. Yeah this is good, thanks for catching it!
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 think I'll wait on #284 and remove those changes from this PR, if that's OK with you @neithernut.
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'd be ok with this. But I doubt that we'll see anything merged in this repo in the near future.
Fixes #305. |
This does very small changes to remove some warnings Clippy complains about.