Skip to content

Commit 0293a3c

Browse files
committed
Refactor: Switch Into<ScriptBuf> to From<ShutdownScript>
.. as Rust advises to only ever implement `From`, and let the compiler derive `Into` automatically.
1 parent 22f3641 commit 0293a3c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lightning/src/ln/script.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ impl TryFrom<(ScriptBuf, &InitFeatures)> for ShutdownScript {
203203
}
204204
}
205205

206-
impl Into<ScriptBuf> for ShutdownScript {
207-
fn into(self) -> ScriptBuf {
208-
match self.0 {
206+
impl From<ShutdownScript> for ScriptBuf {
207+
fn from(value: ShutdownScript) -> Self {
208+
match value.0 {
209209
ShutdownScriptImpl::Legacy(pubkey) => {
210210
ScriptBuf::new_p2wpkh(&WPubkeyHash::hash(&pubkey.serialize()))
211211
},

0 commit comments

Comments
 (0)