Skip to content

Avoid some warnings from Clippy#299

Closed
schneiderfelipe wants to merge 1 commit into
BurntSushi:masterfrom
schneiderfelipe:clippy-complains
Closed

Avoid some warnings from Clippy#299
schneiderfelipe wants to merge 1 commit into
BurntSushi:masterfrom
schneiderfelipe:clippy-complains

Conversation

@schneiderfelipe
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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

Comment thread src/arbitrary.rs
Comment thread src/tester.rs
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
Copy Markdown
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?

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor 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.

Copy link
Copy Markdown
Contributor

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.

Comment thread src/arbitrary.rs Outdated
@schneiderfelipe
Copy link
Copy Markdown
Contributor 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
Copy Markdown
Contributor

Fixes #305.

@jhpratt
Copy link
Copy Markdown
Collaborator

jhpratt commented Mar 6, 2025

GitHub is being buggy, so I've merged this manually 👍

@jhpratt jhpratt closed this Mar 6, 2025
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.

4 participants