rust-lang / hashbrown

Rust port of Google's SwissTable hash map
https://rust-lang.github.io/hashbrown
Apache License 2.0
2.38k stars 275 forks source link

Fix clippy multiple_bound_location warnings #528

Closed ToMe25 closed 3 months ago

ToMe25 commented 3 months ago

This PR moves the ?Sized generics bound used in the map and set source files from the generics predicate to the where clause, if a where clause already exists.

According to what I could find online that ?Sized bound had to be there until rustc 1.15, but since ?Sized is already specified in where clauses in these files I don't think thats an issue.

I always put the ?Sized bound last, because that is where it already appears in the docs, but if ?Sized first is preferred, I'll change that.

This PR also changes the Debug impls for *EntryRef to use a where clause, because they currently have a linebreak in "impl X for Y" line.
If this last change isn't wanted or considered something separate, please let me know :)

Amanieu commented 3 months ago

Thanks!

@bors r+

bors commented 3 months ago

:pushpin: Commit 1c8b69509479663ea23d7090550c0cce3343e9bb has been approved by Amanieu

It is now in the queue for this repository.

bors commented 3 months ago

:hourglass: Testing commit 1c8b69509479663ea23d7090550c0cce3343e9bb with merge f540cb70fe8921a92bc9a8c7329063ca70989d85...

bors commented 3 months ago

:sunny: Test successful - checks-actions Approved by: Amanieu Pushing f540cb70fe8921a92bc9a8c7329063ca70989d85 to master...