]> git.bitcoin.ninja Git - rust-lightning/commitdiff
-f Compile
authorAntoine Riard <dev@ariard.me>
Mon, 6 Sep 2021 18:19:07 +0000 (14:19 -0400)
committerAntoine Riard <dev@ariard.me>
Fri, 17 Sep 2021 22:41:19 +0000 (18:41 -0400)
lightning/src/util/events.rs

index 587291c10d57c355d77f78a14f32caf76a7e97d8..43182c1ddafea7e8cc390d27e808629ca6443f53 100644 (file)
@@ -437,13 +437,10 @@ impl MaybeReadable for Event {
                        // Versions prior to 0.0.100 did not ignore odd types, instead returning InvalidValue.
                        x if x % 2 == 1 => Ok(None),
                        6u8 => {
-                               let f = || {
-                                       let channel_id = Readable::read(reader)?;
-                                       let err = Readable::read(reader)?;
-                                       read_tlv_fields!(reader, {});
-                                       Ok(Some(Event::ChannelClosed { channel_id, err}))
-                               };
-                               f()
+                               let channel_id = Readable::read(reader)?;
+                               let err = Readable::read(reader)?;
+                               read_tlv_fields!(reader, {});
+                               Ok(Some(Event::ChannelClosed { channel_id, err}))
                        },
                        _ => Err(msgs::DecodeError::InvalidValue)
                }