-
Notifications
You must be signed in to change notification settings - Fork 411
Remove low-hanging fruit rustfmt::skips
in ChannelManager pt. 2
#3850
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
base: main
Are you sure you want to change the base?
Remove low-hanging fruit rustfmt::skips
in ChannelManager pt. 2
#3850
Conversation
👋 Thanks for assigning @joostjager as a reviewer! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3850 +/- ##
==========================================
- Coverage 89.94% 89.93% -0.02%
==========================================
Files 163 163
Lines 131655 131826 +171
Branches 131655 131826 +171
==========================================
+ Hits 118421 118556 +135
- Misses 10550 10582 +32
- Partials 2684 2688 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Checked the fmt fixes, LGTM. But still I think we have to be super careful with these "random" refactorings outside the context of a functional PR. Maybe it is okay to not touch it also...
best_block_height, | ||
&self.logger, | ||
&self.pending_events, | ||
|args| self.send_payment_along_path(args), |
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.
Pretty vertical, but also fairly static code, and probably not so easy to refactor.
d034929
to
047a256
Compare
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.
This needs a rebase now.
rustfmt::skips were added recently all over channelmanager in order for formatting to be enforced for all new code added to the file. Here we remove a bunch of those skips that aren't necessary because the methods that are skipped are so short. Does not include cfg(splicing) code. Here we just remove the rustfmt skips, in the next commit we'll clean up the code that rustfmt made too vertical.
In the previous commit we formatted a bunch of short methods. Here we clean up the default formatting that rustfmt applied by extracting code into variables.
047a256
to
a27c1cb
Compare
Rebased |
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.
I do feel the urge to again emphasize that we need to be so careful with "random" refactoring. Especially if we only save a couple of lines compared to naive rustfmt. It doesn't take much for something to slip through.
After #3767 landed, there were a bunch of
rustfmt::skips
added to ChannelManager that could easily be removed.Here we pick some of that low-hanging fruit by removing the skips for methods that are less than ~10 lines long.
Follows on from #3844, since that one landed so easily.