quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

Warn on clippy's use_self lint #1527

Closed djc closed 1 year ago

djc commented 1 year ago

This is generally more concise and in case of a rename avoids having to change a bunch of extra locations.

(Note that clippy warnings fail our CI's lint job.)

aochagavia commented 1 year ago

In case anyone cares... I personally dislike using Self, because it means I have to mentally look up which type it refers to and therefore makes reading the code a bit more difficult (maybe it is just a lack of familiarity, though). I'd rather have a tiny bit less clean diffs when renames happen.

djc commented 1 year ago

See also https://users.rust-lang.org/t/idiomatic-use-of-self/73754.

aochagavia commented 1 year ago

Wow, didn't know this was debated to that length... At least I feel comforted that I'm not alone 😅

Ralith commented 1 year ago

In case anyone cares...

Your input is absolutely valued!

I have to mentally look up which type it refers to

To me, this seems less demanding than any use of self (the expression). The language already aggressively buys into that context, so getting a bit of extra mileage out of it seems like a win.