From ed2e89af5f0489c23770fcd1580adfe11e521d21 Mon Sep 17 00:00:00 2001
From: Matt Johnston <matt@ucc.asn.au>
Date: Wed, 1 Jun 2022 19:54:03 +0800
Subject: [PATCH] more tidy

---
 sshwire_derive/src/lib.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sshwire_derive/src/lib.rs b/sshwire_derive/src/lib.rs
index 2d2ec45..8efe55f 100644
--- a/sshwire_derive/src/lib.rs
+++ b/sshwire_derive/src/lib.rs
@@ -383,7 +383,7 @@ fn decode_struct(gen: &mut Generator, body: StructBody) -> Result<()> {
         .generate_fn("dec")
         .with_generic_deps("S", ["crate::sshwire::SSHSource<'de>"])
         .with_arg("s", "&mut S")
-        .with_return_type(format!("Result<Self>"))
+        .with_return_type("Result<Self>")
         .body(|fn_body| {
             let mut named_enums = HashSet::new();
             if let Fields::Struct(v) = &body.fields {
@@ -391,6 +391,7 @@ fn decode_struct(gen: &mut Generator, body: StructBody) -> Result<()> {
                     let atts = take_field_atts(&f.1.attributes)?;
                     for a in atts {
                         if let FieldAtt::VariantName(enum_field) = a {
+                            // Read the extra field on the wire that isn't directly included in the struct
                             named_enums.insert(enum_field.to_string());
                             fn_body.push_parsed(format!("let enum_name_{enum_field} = crate::sshwire::SSHDecode::dec(s)?;"))?;
                         }
-- 
GitLab