From: Daniele Paoni <daniele@libertyline.com>
To: Proxmox Backup Server development discussion
<pbs-devel@lists.proxmox.com>,
Maximiliano Sandoval <m.sandoval@proxmox.com>
Subject: Re: [pbs-devel] [PATCH v2 backup 4/5] clippy fixes: Box::new(_) of default value
Date: Fri, 16 Jun 2023 10:38:01 +0200 [thread overview]
Message-ID: <188c35ab228.28bf.7e9780bdee4b75f85db1eaaf577f3245@libertyline.com> (raw)
In-Reply-To: <20230616082731.45647-5-m.sandoval@proxmox.com>
[-- Attachment #1: Type: text/plain, Size: 1081 bytes --]
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’s more complex, involving two calls instead of one. Second,
>> Box::default() can be faster in certain cases.
>
> Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.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" => {
> // this one has no config
> - Box::new(StandaloneServer::default())
> + Box::<StandaloneServer>::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
[-- Attachment #2: Type: text/html, Size: 2708 bytes --]
next prev parent reply other threads:[~2023-06-16 8:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-16 8:27 [pbs-devel] [PATCH v2 backup 0/5] Clippy fixes Maximiliano Sandoval
2023-06-16 8:27 ` [pbs-devel] [PATCH v2 backup 1/5] clippy fixes: the borrowed expression implements the required traits Maximiliano Sandoval
2023-06-16 8:27 ` [pbs-devel] [PATCH v2 backup 2/5] clippy fixes: use of ok_or followed by a function call Maximiliano Sandoval
2023-06-16 8:27 ` [pbs-devel] [PATCH v2 backup 3/5] clippy fixes: casting to the same type is unnecessary Maximiliano Sandoval
2023-06-16 8:27 ` [pbs-devel] [PATCH v2 backup 4/5] clippy fixes: Box::new(_) of default value Maximiliano Sandoval
2023-06-16 8:38 ` Daniele Paoni [this message]
2023-06-16 8:27 ` [pbs-devel] [PATCH v2 backup 5/5] clippy fixes: deref which would be done by auto-deref Maximiliano Sandoval
2023-06-23 10:07 ` [pbs-devel] applied-series: [PATCH v2 backup 0/5] Clippy fixes Wolfgang Bumiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=188c35ab228.28bf.7e9780bdee4b75f85db1eaaf577f3245@libertyline.com \
--to=daniele@libertyline.com \
--cc=m.sandoval@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox