Skip to content

Commit b1d97a1

Browse files
committed
Remove useless use of format! throughout splicing errors
1 parent ab086f0 commit b1d97a1

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lightning/src/ln/channel.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11487,9 +11487,9 @@ where
1148711487
// MUST send a warning and close the connection or send an error
1148811488
// and fail the channel.
1148911489
if !self.context.is_live() {
11490-
return Err(ChannelError::WarnAndDisconnect(format!(
11491-
"Splicing requested on a channel that is not live"
11492-
)));
11490+
return Err(ChannelError::WarnAndDisconnect(
11491+
"Splicing requested on a channel that is not live".to_owned(),
11492+
));
1149311493
}
1149411494

1149511495
// TODO(splicing): Once splice acceptor can contribute, check that inputs are sufficient,
@@ -11737,20 +11737,20 @@ where
1173711737
let funding_negotiation_context = match &self
1173811738
.pending_splice
1173911739
.as_ref()
11740-
.ok_or(ChannelError::Ignore(format!("Channel is not in pending splice")))?
11740+
.ok_or(ChannelError::Ignore("Channel is not in pending splice".to_owned()))?
1174111741
.funding_negotiation
1174211742
{
1174311743
Some(FundingNegotiation::AwaitingAck(context)) => context,
1174411744
Some(FundingNegotiation::ConstructingTransaction(_, _))
1174511745
| Some(FundingNegotiation::AwaitingSignatures(_)) => {
11746-
return Err(ChannelError::WarnAndDisconnect(format!(
11747-
"Got unexpected splice_ack; splice negotiation already in progress"
11748-
)));
11746+
return Err(ChannelError::WarnAndDisconnect(
11747+
"Got unexpected splice_ack; splice negotiation already in progress".to_owned(),
11748+
));
1174911749
},
1175011750
None => {
11751-
return Err(ChannelError::Ignore(format!(
11752-
"Got unexpected splice_ack; no splice negotiation in progress"
11753-
)));
11751+
return Err(ChannelError::Ignore(
11752+
"Got unexpected splice_ack; no splice negotiation in progress".to_owned(),
11753+
));
1175411754
},
1175511755
};
1175611756

@@ -11847,7 +11847,7 @@ where
1184711847
let pending_splice = match self.pending_splice.as_mut() {
1184811848
Some(pending_splice) => pending_splice,
1184911849
None => {
11850-
return Err(ChannelError::Ignore(format!("Channel is not in pending splice")));
11850+
return Err(ChannelError::Ignore("Channel is not in pending splice".to_owned()));
1185111851
},
1185211852
};
1185311853

0 commit comments

Comments
 (0)