Conversation
|
Can you explain why this is an improvement? This is a lot of churn, and I'm not sure this is more readable. |
|
To make this a bit more automated, probably @alice-i-cecile according to Clippy:
|
i've updated the task description. it is a lot of churn |
|
Thanks for the description update. Can you add the lint as a warning level to the CI and contributing instructions? Follow the example set by https://github.com/bevyengine/bevy/search?p=1&q=type_complexity. I'm still not in favor of this change, but we should see what others think. |
|
This is primarily a stylistic change, but one I can get behind, provided we indeed apply it consistently. I cast my vote of confidence for this kind of change. There is a lot of churn here, but given the context it's pretty easy to see it's, for the most part, just a bunch of renames, which shouldn't be too big of an issue bar possible merge conflicts. |
|
I find code that overuses Also, I would like to avoid nursery / pedantic clippy lints that don't have a clear value to the Bevy user. All the advantages you quoted are to the Bevy developer, and feel opinionated. |
My opinionI don't mind using I think the real problem this PR tries to solve is that we should be consistent throughout and not that we have to always use The best thing to do would probably be to talk about particular cases and see what we like best for the common use cases. This will probably result in having a mixture of In the cases listed below I prefer using Cases
|
|
I agree that consistency is valuable. In general, I prefer the explicit types wherever possible: I find they're much easier to read in PRs and large impl blocks. This is especially true when |
|
I'll throw my bike in this shed; I like the idea of using In a world where we would only use the name |
|
I... don't really see a clear consensus here, but I'll make a couple of observations and then we can argue about those
so putting aside sticking with the status quo, there are 3 options a. use Some notes on the above-
my personal two cents - it's hard to see that defining, introducing, and maintaining a |
This is a great analysis and I couldn't have stated this conclusion better myself. Closing this out. |
use the
Selfkeyword throughoutSelfis currently used inconsistently throughout this codebaseSelfis usually less verbose, and more readable than stating the type and generics redundantlySelfare 'constructors'Selfreferences do not need to be updatedSelfsimplifies proc macros, as it avoids having to write out#type_name #ty_genericsin everyquote!blockfn function(self: FullyQualifiedSelf)that can be simplified tofn function(self)as @daxpedda points out, you can use
clippy::use_selfto identify these (i've added it to my local cargo config file)