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

Fixes clippy for consumers #256

Merged
merged 1 commit into from
Aug 27, 2020
Merged

Fixes clippy for consumers #256

merged 1 commit into from
Aug 27, 2020

Conversation

tarikeshaq
Copy link
Contributor

fixes #254

Adds #[allow(clippy::all)] in all generated functions.

A WAY nicer way to do this is to add #![allow(clippy::all)] but unfortunately that doesn't work because of rust-lang/rfcs#752, although I would be happy if there is a different way to disable clippy on the whole generated file without asking the consumer to do so.

Note: I did not add the #[allow(clippy::all)] for anything other than the functions purely because they didn't complain, I'd be happy to go around doing that if we need to.

I also fixed some clippy errors that popped up (not sure if it's because I updated to 1.46)

@@ -89,6 +89,9 @@
//! to load and use the compiled rust code via its C-compatible FFI.
//!

#![warn(rust_2018_idioms)]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The compiler started telling me that the #![warn(rust_2018_idioms)] is ignored if it's not at the crate level, so I moved those here

Copy link
Collaborator

@rfk rfk left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! I think it would be better to generate clippy-compliant code, but that's a much bigger change that is probably not a good use of our time short-term. Do you think it would be worth a follow-up bug?

uniffi_bindgen/src/templates/RustString.rs Outdated Show resolved Hide resolved
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.

Fix clippy for generated code
2 participants