From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ronja.mits.lan by ronja.mits.lan with LMTP id YOWoNF/9e2YwbAAAxxbTJA (envelope-from ); Wed, 26 Jun 2024 13:37:03 +0200 Received: from proxmox-new.maurer-it.com (unknown [192.168.2.33]) by ronja.mits.lan (Postfix) with ESMTPS id BB92BF64634; Wed, 26 Jun 2024 13:37:03 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 9E7764872D; Wed, 26 Jun 2024 13:37:03 +0200 (CEST) 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 (4096 bits)) (No client certificate requested) by proxmox-new.maurer-it.com (Proxmox) with ESMTPS; Wed, 26 Jun 2024 13:37:02 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BEBBD1EC3C; Wed, 26 Jun 2024 13:37:01 +0200 (CEST) Mime-Version: 1.0 Date: Wed, 26 Jun 2024 13:36:27 +0200 Message-Id: From: "Shannon Sterz" To: "Proxmox Backup Server development discussion" X-Mailer: aerc 0.17.0-69-g65571b67d7d3-dirty References: <20240626104514.384718-1-m.sandoval@proxmox.com> <20240626104514.384718-17-m.sandoval@proxmox.com> In-Reply-To: <20240626104514.384718-17-m.sandoval@proxmox.com> Subject: Re: [pbs-devel] [PATCH proxmox 17/18] acme-api: remove manual implementation of Option::map 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: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" X-SPAM-LEVEL: Spam detection results: 1 DMARC_MISSING 0.1 Missing DMARC policy KAM_ASCII_DIVIDERS 0.8 Email that uses ascii formatting dividers and possible spam tricks KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods MAILING_LIST_MULTI -2 Multiple indicators imply a widely-seen list manager RAZOR2_CF_RANGE_51_100 2.43 Razor2 gives confidence level above 50% RAZOR2_CHECK 1.729 Listed in Razor2 (http://razor.sf.net/) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record On Wed Jun 26, 2024 at 12:45 PM CEST, Maximiliano Sandoval wrote: > Fixes the clippy warning: > > warning: manual implementation of `Option::map` > --> proxmox-acme-api/src/certificate_helpers.rs:346:32 > | > 346 | } else if let Some(uri) = name.uri() { > | ________________________________^ > 347 | | Some(format!("URI: {uri}")) > 348 | | } else { > 349 | | None > 350 | | } > | |_________________________^ help: try: `{ name.uri().map(|uri| format!("URI: {uri}")) }` > | > = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map > = note: `#[warn(clippy::manual_map)]` on by default > > Signed-off-by: Maximiliano Sandoval > --- > proxmox-acme-api/src/certificate_helpers.rs | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/proxmox-acme-api/src/certificate_helpers.rs b/proxmox-acme-api/src/certificate_helpers.rs > index dd8385e2..473bd0e1 100644 > --- a/proxmox-acme-api/src/certificate_helpers.rs > +++ b/proxmox-acme-api/src/certificate_helpers.rs > @@ -343,11 +343,7 @@ impl CertificateInfo { > Some(format!("IP: {ip:?}")) > } else if let Some(email) = name.email() { > Some(format!("EMAIL: {email}")) > - } else if let Some(uri) = name.uri() { > - Some(format!("URI: {uri}")) > - } else { > - None > - } > + } else { name.uri().map(|uri| format!("URI: {uri}")) } did you rustfmt this? over here it doesn't like the "single line else" and imo it looks quite akward > }) > .collect() > }) _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel