Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Avoid some warnings from Clippy #299

wants to merge 1 commit into from

Conversation

schneiderfelipe
Copy link

This does very small changes to remove some warnings Clippy complains about.

Copy link

@neithernut neithernut left a 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).

src/arbitrary.rs Show resolved Hide resolved
@@ -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()),
Copy link
Owner

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?

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.

Copy link
Owner

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!

Copy link
Author

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.

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.

src/arbitrary.rs Outdated Show resolved Hide resolved
@schneiderfelipe
Copy link
Author

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).

Thanks for letting me know! I think that with the panic!(..., format!(...)) thing this PR covers #284 as well.

@neithernut
Copy link

Fixes #305.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants