From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id DCB8A1FF0E2 for ; Thu, 30 Jul 2026 12:56:05 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id A6407213A7; Thu, 30 Jul 2026 12:56:05 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 30 Jul 2026 12:56:00 +0200 Message-Id: From: "Max R. Carrara" Subject: Re: [PATCH perlmod v2 4/5] macro: function: move signature inputs handling into helper struct To: "Wolfgang Bumiller" X-Mailer: aerc 0.18.2-0-ge037c095a049 References: <20260724144914.658730-1-m.carrara@proxmox.com> <20260724144914.658730-5-m.carrara@proxmox.com> <178540701947.33538.12090262967135005646.b4-review@b4> In-Reply-To: <178540701947.33538.12090262967135005646.b4-review@b4> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1785408952380 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.025 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: S6EPJTQLXSLRJ3XRXR2S4SMS2J7MT4VT X-Message-ID-Hash: S6EPJTQLXSLRJ3XRXR2S4SMS2J7MT4VT X-MailFrom: m.carrara@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: pve-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu Jul 30, 2026 at 12:23 PM CEST, Wolfgang Bumiller wrote: > On Fri, 24 Jul 2026 16:49:06 +0200, Max R. Carrara wrote: > > diff --git a/perlmod-macro/src/function.rs b/perlmod-macro/src/function= .rs > > index 3ca7bd0..f5415c5 100644 > > --- a/perlmod-macro/src/function.rs > > +++ b/perlmod-macro/src/function.rs > > @@ -210,6 +210,171 @@ fn deserialized_argument_code( > > [ ... skip 44 lines ... ] > > + let arg_attr =3D ArgumentAttr::new_from_fn_arg(arg)?; > > + > > + let arg_type: &syn::Type =3D arg_attr.pat_type.ty.as_ref()= ; > > + > > + let arg_name =3D { > > + let pattern: &syn::Pat =3D arg_attr.pat_type.pat.as_re= f(); > > This binding is unnecessary - let's drop the enclosing block and > indentation and match directly=E2=80=A6 Looking at this again, yeah I agree -- will fix in v3. Thanks! > > > + match pattern { > > + syn::Pat::Ident(ident) =3D> { > > + if ident.by_ref.is_some() { > > + bail!(ident =3D> "xsub does not support by= -ref parameters"); > > + } > > + if ident.subpat.is_some() { > > + bail!(ident =3D> "xsub does not support su= b-patterns on parameters"); > > + } > > + &ident.ident > > + } > > + _ =3D> bail!(pattern =3D> "xsub does not support t= his kind of parameter"), > > =E2=80=A6 =E2=86=91 with `s/_/pattern/` here. > > > @@ -451,36 +527,48 @@ pub fn handle_function( > > [ ... skip 30 lines ... ] > > - proto.push(';'); > > - for _ in 0..trailing_options { > > - proto.push('$'); > > + > > + match (trailing_options, trailing_type) { > > + (1.., ty) =3D> { > > Not too happy about this - the `if` previously was sufficient, and the > `match` now doesn't do any matching on `trailing_type` - it just rebinds > it to `ty`, so just more indentation for no gain? Same as above here; looks odd now that I look at it again. Will also fix in v3, thanks!