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

Reduce line count #572

Merged
merged 3 commits into from
Sep 23, 2023
Merged

Conversation

tcharding
Copy link
Member

This PR is formatting changes only, totally non-urgent.

Reduce line count by setting a couple of rustfmt config options to be the same as they are in rust-bitcoin. Final patch removes whitespace in trait impl blocks, and was the impetus for this PR.

@apoelstra
Copy link
Member

I think increasing chain_width is mostly a bad change.

@apoelstra
Copy link
Member

But 0c7a972 looks good otherwise.

@tcharding
Copy link
Member Author

I split each config option change into a separate patch so they can be viewed easily. I actually think the only massive win is fn_single_line and maybe struct_lit_width.

@tcharding
Copy link
Member Author

tcharding commented Jul 27, 2023

FTR docs say the values are a percentage of max_width but anything over 80 causes an error, so there is a bug somewhere.

fn_call_width cannot have a value that exceeds max_width. fn_call_width will be set to the same value as max_width

@apoelstra
Copy link
Member

Not really a fan of the array_width change either.

Otherwise 75d3fa8 looks good.

@tcharding
Copy link
Member Author

Not really a fan of the array_width change either.

No worries, I'll drop that commit - that is exactly why I kept them all separate :)

@tcharding
Copy link
Member Author

Force push removes the array_width change (was the last patch of the series).

@tcharding
Copy link
Member Author

tcharding commented Aug 7, 2023

Otherwise 75d3fa8 looks good.

Just in case you go looking for it, this is the commit hash of the removed patch.

apoelstra
apoelstra previously approved these changes Aug 8, 2023
Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK 1cab0b8

@tcharding
Copy link
Member Author

Rebased, no other changes.

apoelstra
apoelstra previously approved these changes Aug 9, 2023
Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK f41a70d

Set `rustfmt` config option `fn_single_line` to true and run the
formatter.
Set `rustfmt` config option `fn_call_width` to 80 and run the
formatter.
Set `rustfmt` config option `struct_lit_width` to true and run the
formatter.
@tcharding
Copy link
Member Author

Re-done after planning module merging. @TheBlueMatt this one should make you all warm and fuzzy inside :)

@sanket1729
Copy link
Member

@tcharding, what order do you prefer I merge the PRs?

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK 26bb52e

@tcharding
Copy link
Member Author

tcharding commented Sep 22, 2023

This one first please, it will cause loads of conflicts but that is always going to be the case whenever it merges. I meant "first" as in out of my PRs, do other peoples before mine please, I'm happy to rebase.

@apoelstra apoelstra merged commit 3c6ae26 into rust-bitcoin:master Sep 23, 2023
16 checks passed
@tcharding tcharding deleted the 07-25-reduce-line-count branch September 25, 2023 22:14
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.

3 participants