-
Notifications
You must be signed in to change notification settings - Fork 412
Remove low-hanging fruit rustfmt::skip
s in ChannelManager
#3844
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
Remove low-hanging fruit rustfmt::skip
s in ChannelManager
#3844
Conversation
👋 Thanks for assigning @joostjager as a reviewer! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3844 +/- ##
==========================================
- Coverage 89.87% 89.83% -0.05%
==========================================
Files 162 162
Lines 130214 130415 +201
Branches 130214 130415 +201
==========================================
+ Hits 117034 117159 +125
- Misses 10486 10553 +67
- Partials 2694 2703 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
This code is not at risk of unwanted rebase conflicts, so the skips can safely be removed. Also did one minor extraction into a variable.
f752e7f
to
1532913
Compare
funding_transaction, | ||
) | ||
let temporary_chan = &[(&temporary_channel_id, &counterparty_node_id)]; | ||
self.batch_funding_transaction_generated(temporary_chan, funding_transaction) |
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 don't think this change is necessary, but no objection either.
@@ -713,6 +713,10 @@ impl_writeable_tlv_based_enum!(SentHTLCId, | |||
}, | |||
); | |||
|
|||
// (src_channel_id, src_counterparty_node_id, src_funding_outpoint, src_chan_id, src_user_chan_id) | |||
type PerSourcePendingForward = |
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.
Shouldn't this just be a struct now? Pre-existing though.
self.abandon_payment_with_reason(payment_id, PaymentFailureReason::BlindedPathCreationFailed); | ||
res = Err(Bolt12PaymentError::BlindedPathCreationFailed); | ||
return NotifyOption::DoPersist | ||
let enqueue_held_htlc_available_res = self.flow.enqueue_held_htlc_available( |
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.
Could be risk-reducing to keep every change that isn't strictly rustfmt in a separate commit.
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.
Going ahead landing this.
After #3767 landed, there were a bunch of
rustfmt::skip
s added toChannelManager
that could easily be removed.Here we pick some of that low-hanging fruit by removing the skips for methods that are less than ~5 lines long.
We also remove skips from all
cfg(async_payments)
code since as the feature owner I know that's safe from unwanted rebase conflicts.