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

Address clippy warnings #55

Merged
merged 2 commits into from
Oct 31, 2019
Merged

Address clippy warnings #55

merged 2 commits into from
Oct 31, 2019

Conversation

ebuchman
Copy link
Member

I couldn't figure out how to remove the extern crate with the rename here. I read https://doc.rust-lang.org/nightly/edition-guide/rust-2018/module-system/path-clarity.html#renaming-crates, but couldn't get it working. Possibly it's because I needed to edit alot more files, but didn't feel I should have to do that. So I also tried https://doc.rust-lang.org/1.28.0/cargo/reference/unstable.html#rename-dependency, but couldn't get it working either. So I just turned off the lint in one spot ...

Also the config_toml_parser could be broken out a bit but didn't seem like a big deal to just disable the lint for now.

@@ -18,7 +18,12 @@
html_root_url = "https://docs.rs/tendermint/0.10.0"
)]

// NOTE(EB): can't figure out how to easily remove the extern crate per Rust2018 upgrade ...
#[allow(unused_extern_crates)]
extern crate prost_amino as prost;
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably the easiest way to actually fix this is through the Cargo.toml:

prost = { package = "prost-amino", version = "0.4.0" }
prost-derive = { package = "prost-amino-derive", version = "0.4.0" }

Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't able to get this working. When I try it and then comment out these extern crate lines, I get tons of errors.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ebuchman oh, I bet it hasn't been updated to the 2018 edition, so prost-amino-derive is still dependent on the extern crate directives.

Probably the best solution would be to switch to upstream prost when Amino has been fully replaced with protos.

Copy link
Member Author

Choose a reason for hiding this comment

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

lol cannot wait!

Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

LGTM!

I addressed a few more here:
1a232e5
Not sure why clippy didn't complain about these here.

@tarcieri
Copy link
Contributor

You may also want to add:

#![warn(rust_2018_idioms)]

...to the top of lib.rs

@ebuchman
Copy link
Member Author

You may also want to add:

I'm using cargo clippy --all --all-targets -- -Dwarnings -Drust-2018-idioms which is what's being run in CircleCI, which presumably achieves the same result?

@ebuchman ebuchman merged commit 262e252 into master Oct 31, 2019
@ebuchman ebuchman deleted the bucky/fix-lint branch October 31, 2019 19:10
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.

None yet

3 participants