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

Some minor lints #132

Merged
merged 1 commit into from
Aug 8, 2022
Merged

Some minor lints #132

merged 1 commit into from
Aug 8, 2022

Conversation

nyurik
Copy link
Contributor

@nyurik nyurik commented Jul 30, 2022

  • use #[must_use] for Self-returning fn
  • some minor docs for panics
  • use Self instead of a specific type in some cases

I used this command to test:

❯ cargo clippy -- -W clippy::default_trait_access -W clippy::missing_panics_doc -W clippy::return-self-not-must-use -W clippy::semicolon-if-nothing-returned -W clippy::trait-duplication-in-bounds

There is only one issue remaining that I'm not certain how to fix (or if its even needed to be fixed?):

warning: this trait bound is already specified in the where clause
  --> postgres/src/lib.rs:52:46
   |
52 |     <Tls as MakeTlsConnect<Socket>>::Stream: Send + Sync,
   |                                              ^^^^
   |
   = note: requested on the command line with `-W clippy::trait-duplication-in-bounds`
   = help: consider removing this trait bound
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trait_duplication_in_bounds

See #131 . I tried to add a clippy.toml file to make this more consistent, but that seems not to work properly -- rust-lang/rust-clippy#9265

Copy link
Owner

@djc djc left a comment

Choose a reason for hiding this comment

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

Thanks, this is looking pretty good!

bb8/src/api.rs Outdated Show resolved Hide resolved
@djc
Copy link
Owner

djc commented Aug 1, 2022

Looks to me like the trait-duplication-in-bounds issue is a clippy false positive, might be worth filing an issue about that.

* use `#[must_use]` for Self-returning fn
* some minor docs for panics
* use `Self` instead of a specific type in some cases
@nyurik
Copy link
Contributor Author

nyurik commented Aug 5, 2022

thx, fixed

@djc djc merged commit 098e95d into djc:main Aug 8, 2022
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

2 participants