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)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id A1332A1BFD for ; Fri, 16 Jun 2023 10:48:11 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7B77A2FF74 for ; Fri, 16 Jun 2023 10:47:41 +0200 (CEST) Received: from mail.libertyline.com (mail.libertyline.com [37.72.36.115]) (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 ; Fri, 16 Jun 2023 10:47:40 +0200 (CEST) Received: from [10.212.235.88] (unknown [151.82.179.212]) (Authenticated sender: daniele@libertyline.com) by mail.libertyline.com (Postfix) with ESMTPSA id 9B6FBCC00DC; Fri, 16 Jun 2023 10:38:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libertyline.com; s=default; t=1686904683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4J2gXGkX71qH12LH5G/1ynQ/b7/vAg98W6bX5PJuRFE=; b=cu4Sd9OstOjhssQJHMFal5yRWnrsJHqJ8KK9J7NRi5ehb2ZjIFyMONQZmKtnjM5fR6/qF5 5EOBkEce/Io1ZyRY7WH1M8WUKla7eh3VheuC0KmWkpSg05UWlHKOjdRh7oU/Fz8SJ0gwct pETvmlFxAUMButw7eFwO1AF2iRVmSOQ= Authentication-Results: mail.libertyline.com; auth=pass smtp.auth=daniele@libertyline.com smtp.mailfrom=daniele@libertyline.com From: Daniele Paoni To: Proxmox Backup Server development discussion , Maximiliano Sandoval Date: Fri, 16 Jun 2023 10:38:01 +0200 Message-ID: <188c35ab228.28bf.7e9780bdee4b75f85db1eaaf577f3245@libertyline.com> In-Reply-To: <20230616082731.45647-5-m.sandoval@proxmox.com> References: <20230616082731.45647-1-m.sandoval@proxmox.com> <20230616082731.45647-5-m.sandoval@proxmox.com> User-Agent: AquaMail/1.44.2 (build: 104402294) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="188c35ab30d703228bfeb0f5b" X-SPAM-LEVEL: Spam detection results: 0 BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy HTML_MESSAGE 0.001 HTML included in message JMQ_SPF_NEUTRAL 0.5 SPF set to ?all RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust RCVD_IN_MSPIKE_H2 -0.001 Average reputation (+2) 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 v2 backup 4/5] clippy fixes: Box::new(_) of default value 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: Fri, 16 Jun 2023 08:48:11 -0000 This is a multi-part message in MIME format. --188c35ab30d703228bfeb0f5b Content-Type: text/plain; format=flowed; charset="UTF-8" Content-Transfer-Encoding: 8bit Yk In data 16 giugno 2023 10:27:35 Maximiliano Sandoval ha scritto: > From rust-lang: > >> Why is this bad? >> >> First, it’s more complex, involving two calls instead of one. Second, >> Box::default() can be faster in certain cases. > > Signed-off-by: Maximiliano Sandoval > --- > src/acme/plugin.rs | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/acme/plugin.rs b/src/acme/plugin.rs > index 478d0666..5fe8993d 100644 > --- a/src/acme/plugin.rs > +++ b/src/acme/plugin.rs > @@ -35,7 +35,7 @@ pub(crate) fn get_acme_plugin( > } > "standalone" => { > // this one has no config > - Box::new(StandaloneServer::default()) > + Box::::default() > } > other => bail!("missing implementation for plugin type '{}'", other), > })) > -- > 2.39.2 > > > > _______________________________________________ > pbs-devel mailing list > pbs-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel --188c35ab30d703228bfeb0f5b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Yk 

In data 16 giugno 2023 10:27:35 Maximiliano Sandoval <= m.sandoval@proxmox.com> ha scritto:

From rust-lang:

Why is this bad?

First, it=E2=80=99s more complex, involving two calls ins= tead of one. Second,
Box::default() can be faster in certain cases.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmo= x.com>
---
 src/acme/plugin.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/acme/plugin.rs b/src/acme/plugin.rs
index 478d0666..5fe8993d 100644
--- a/src/acme/plugin.rs
+++ b/src/acme/plugin.rs
@@ -35,7 +35,7 @@ pub(crate) fn get_acme_plugin(
         }
         "standalone" =3D> {<= /div>
             // this o= ne has no config
-            Box::new(Stand= aloneServer::default())
+            Box::<Stand= aloneServer>::default()
         }
         other =3D> bail!("mi= ssing implementation for plugin type '{}'", other),
     }))
-- 
2.39.2



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-de= vel

--188c35ab30d703228bfeb0f5b--