From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 039D49121D for ; Tue, 13 Feb 2024 17:02:05 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D8A85391A0 for ; Tue, 13 Feb 2024 17:01:34 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 13 Feb 2024 17:01:33 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 94AB047CB9 for ; Tue, 13 Feb 2024 17:01:33 +0100 (CET) References: <20240213124329.411737-1-m.sandoval@proxmox.com> <20240213124329.411737-2-m.sandoval@proxmox.com> <1707832707.8atxyms769.astroid@yuna.none> User-agent: mu4e 1.10.8; emacs 29.1 From: Maximiliano Sandoval To: Proxmox Backup Server development discussion Date: Tue, 13 Feb 2024 16:49:53 +0100 In-reply-to: <1707832707.8atxyms769.astroid@yuna.none> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.019 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pbs-devel] [PATCH backup v3 2/2] api: use if-let pattern for error-only handling X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2024 16:02:05 -0000 Fabian Gr=C3=BCnbichler writes: >> async fn getxattr(&self, inode: u64, xattr: &OsStr) -> Result { >> // TODO: pxar::Accessor could probably get a more optimized met= hod to fetch a specific >> // xattr for an entry... >> let xattrs =3D self.listxattrs(inode).await?; >> - for entry in xattrs { >> - if entry.name().to_bytes() =3D=3D xattr.as_bytes() { >> - return Ok(entry); >> - } >> + if xattrs >> + .iter() >> + .any(|entry| request.add_c_string(entry.name()).is_full()) >> + { >> + return Ok(entry); > > but this here is an obvious copy paste error that doesn't even compile! > please check patches before sending, even if they are supposedly trivial > style fixes! My bad, I thought `cargo build` on the root was enough to test this change. Will sent a vN tomorrow splitting the commits, and fixing this. -- Maximiliano