Skip to content

Commit 254362c

Browse files
committed
Remove Result from into_channel methods
These methods always return Ok, so there is no need to use a Result.
1 parent 3068c8c commit 254362c

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

lightning/src/ln/channel.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8882,14 +8882,12 @@ impl<SP: Deref> OutboundV2Channel<SP> where SP::Target: SignerProvider {
88828882
}
88838883
}
88848884

8885-
pub fn into_channel(self) -> Result<Channel<SP>, ChannelError>{
8885+
pub fn into_channel(self) -> Channel<SP> {
88868886
debug_assert!(self.signing_session.is_some());
8887-
let channel = Channel {
8887+
Channel {
88888888
context: self.context,
88898889
interactive_tx_signing_session: self.signing_session,
8890-
};
8891-
8892-
Ok(channel)
8890+
}
88938891
}
88948892
}
88958893

@@ -9079,14 +9077,12 @@ impl<SP: Deref> InboundV2Channel<SP> where SP::Target: SignerProvider {
90799077
self.generate_accept_channel_v2_message()
90809078
}
90819079

9082-
pub fn into_channel(self) -> Result<Channel<SP>, ChannelError>{
9080+
pub fn into_channel(self) -> Channel<SP> {
90839081
debug_assert!(self.signing_session.is_some());
9084-
let channel = Channel {
9082+
Channel {
90859083
context: self.context,
90869084
interactive_tx_signing_session: self.signing_session,
9087-
};
9088-
9089-
Ok(channel)
9085+
}
90909086
}
90919087
}
90929088

lightning/src/ln/channelmanager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8332,8 +8332,8 @@ where
83328332

83338333
let (channel_id, channel_phase) = chan_phase_entry.remove_entry();
83348334
let channel = match channel_phase {
8335-
ChannelPhase::UnfundedOutboundV2(chan) => chan.into_channel(),
8336-
ChannelPhase::UnfundedInboundV2(chan) => chan.into_channel(),
8335+
ChannelPhase::UnfundedOutboundV2(chan) => Ok(chan.into_channel()),
8336+
ChannelPhase::UnfundedInboundV2(chan) => Ok(chan.into_channel()),
83378337
_ => {
83388338
debug_assert!(false); // It cannot be another variant as we are in the `Ok` branch of the above match.
83398339
Err(ChannelError::Warn(

0 commit comments

Comments
 (0)