-
Notifications
You must be signed in to change notification settings - Fork 163
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
Readability improvements #4928
Readability improvements #4928
Conversation
I think I prefer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, CI is failing.
I didn't touch This often reduces line breaking, many expressions become one-liners. |
It seems self-inconsistent that you're changing code to use turbofish in |
Vec::from_iter( | ||
WeekCalculator::try_new(&locale!("und").into()) | ||
.unwrap() | ||
.weekend() | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a case where we need to increase indentation.
// Max indent 3
WeekCalculator::try_new(&locale!("und").into())
.unwrap()
.weekend()
.collect::<Vec<_>>(),
// Max indent 4
Vec::from_iter(
WeekCalculator::try_new(&locale!("und").into())
.unwrap()
.weekend()
),
I'm being somewhat picky with this review because the PR is literally entitled "Readability improvements" and I disagree that these are all consistently improvements. |
I would love to change code to |
So it sounds like you would be in support of Evidence: 98.8k instances of |
I'm not a fan of the turbofish if it can be avoided, I prefer using a constructor-like method (like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems we're not in alignment on what is more readable, so I added "discuss-priority"
This started out as docs improvements, but I've also touched non-docs code now.
becomes
======
becomes
(this shorter, less symbol salad, does
into_iter()
, and puts the type upfront)======
becomes
(this is shorter, and better for refactorings, as the expression has a type)
======
becomes
(this is better for refactorings, as the expression has a type)