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

fix some clippy warnings #1369

Merged
merged 4 commits into from
Nov 23, 2020
Merged

fix some clippy warnings #1369

merged 4 commits into from
Nov 23, 2020

Conversation

MarcoIeni
Copy link
Contributor

No description provided.

@MarcoIeni
Copy link
Contributor Author

It looks like the matches! macro was introduced in rust 1.42.
We can either:

  • increase minimum rust version to 1.42
  • revert the changes regarding the matches! macro and opt out those clippy warnings in order to never appear again when you run cargo clippy

Copy link
Collaborator

@eth-p eth-p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like most of these changes, but I'm not a fan of using matches! everywhere. It has its uses, but I find it makes it harder to immediately understand what's happening. It's also not something I would consider worth bumping the minimum version for.

I've seen other projects disable that Clippy rule, and I would be in favor of doing it for bat. @sharkdp @keith-hall, your thoughts?

src/bin/bat/app.rs Outdated Show resolved Hide resolved
src/bin/bat/app.rs Outdated Show resolved Hide resolved
src/input.rs Outdated Show resolved Hide resolved
src/output.rs Outdated Show resolved Hide resolved
@MarcoIeni
Copy link
Contributor Author

Ok, so both eth-p and sharkdp seems to agree they want to go for option 2:

  • revert the changes regarding the matches! macro and opt out those clippy warnings in order to never appear again when you run cargo clippy

If you confirm that I will do it :)

@sharkdp
Copy link
Owner

sharkdp commented Nov 15, 2020

Ok, so both eth-p and sharkdp seems to agree they want to go for option 2:

  • revert the changes regarding the matches! macro and opt out those clippy warnings in order to never appear again when you run cargo clippy

If you confirm that I will do it :)

I'd rather not add any clippy-annotations.

If we can keep backwards compatibility for now, that would be great.

@MarcoIeni
Copy link
Contributor Author

I'd rather not add any clippy-annotations.

Why? If we add them we can add clippy to the CI.

Copy link
Owner

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@sharkdp
Copy link
Owner

sharkdp commented Nov 23, 2020

I'd rather not add any clippy-annotations.

Why? If we add them we can add clippy to the CI.

I don't want to force contributors to fix clippy suggestions in order to get a successful CI build.

@sharkdp sharkdp merged commit 1fbdef0 into sharkdp:master Nov 23, 2020
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