]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Reformat `channel_state.rs` to match rustfmt requirements
authorMatt Corallo <git@bluematt.me>
Tue, 4 Jun 2024 01:13:40 +0000 (01:13 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 4 Jun 2024 14:21:08 +0000 (14:21 +0000)
lightning/src/ln/channel_state.rs

index 776e742f3fecabb2e76ca982051238e21e6059a7..4a08e4022e655aca24303e67991e5087831448da 100644 (file)
@@ -468,11 +468,11 @@ impl ChannelDetails {
 
        pub(super) fn from_channel_context<SP: Deref, F: Deref>(
                context: &ChannelContext<SP>, best_block_height: u32, latest_features: InitFeatures,
-               fee_estimator: &LowerBoundedFeeEstimator<F>
+               fee_estimator: &LowerBoundedFeeEstimator<F>,
        ) -> Self
        where
                SP::Target: SignerProvider,
-               F::Target: FeeEstimator
+               F::Target: FeeEstimator,
        {
                let balance = context.get_available_balances(fee_estimator);
                let (to_remote_reserve_satoshis, to_self_reserve_satoshis) =
@@ -490,15 +490,26 @@ impl ChannelDetails {
                                // Else `Channel::get_counterparty_htlc_minimum_msat` could return the
                                // default `0` value set by `Channel::new_outbound`.
                                outbound_htlc_minimum_msat: if context.have_received_message() {
-                                       Some(context.get_counterparty_htlc_minimum_msat()) } else { None },
+                                       Some(context.get_counterparty_htlc_minimum_msat())
+                               } else {
+                                       None
+                               },
                                outbound_htlc_maximum_msat: context.get_counterparty_htlc_maximum_msat(),
                        },
                        funding_txo: context.get_funding_txo(),
                        // Note that accept_channel (or open_channel) is always the first message, so
                        // `have_received_message` indicates that type negotiation has completed.
-                       channel_type: if context.have_received_message() { Some(context.get_channel_type().clone()) } else { None },
+                       channel_type: if context.have_received_message() {
+                               Some(context.get_channel_type().clone())
+                       } else {
+                               None
+                       },
                        short_channel_id: context.get_short_channel_id(),
-                       outbound_scid_alias: if context.is_usable() { Some(context.outbound_scid_alias()) } else { None },
+                       outbound_scid_alias: if context.is_usable() {
+                               Some(context.outbound_scid_alias())
+                       } else {
+                               None
+                       },
                        inbound_scid_alias: context.latest_inbound_scid_alias(),
                        channel_value_satoshis: context.get_value_satoshis(),
                        feerate_sat_per_1000_weight: Some(context.get_feerate_sat_per_1000_weight()),