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 D712E91F5B for ; Wed, 31 Jan 2024 14:51:04 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A5E103B5DC for ; Wed, 31 Jan 2024 14:50: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 ; Wed, 31 Jan 2024 14:50: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 D77A649380 for ; Wed, 31 Jan 2024 14:50:32 +0100 (CET) Date: Wed, 31 Jan 2024 14:50:31 +0100 From: Christoph Heiss To: Aaron Lauterer Cc: Proxmox VE development discussion Message-ID: <5g4yt7ws6codiw75gn2n2ashx6ru4hwqgxt7pa57dntiplcvff@5xb5flirfi5r> References: <20240123170053.490250-1-a.lauterer@proxmox.com> <20240123170053.490250-9-a.lauterer@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240123170053.490250-9-a.lauterer@proxmox.com> X-SPAM-LEVEL: Spam detection results: 2 AWL -0.047 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 FSL_BULK_SIG 1.93 Bulk signature with no Unsubscribe KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RAZOR2_CF_RANGE_51_100 1.886 Razor2 gives confidence level above 50% RAZOR2_CHECK 0.922 Listed in Razor2 (http://razor.sf.net/) 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 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [answer.rs, proxmox.com, lib.rs, github.io] URIBL_SBL_A 0.1 Contains URL's A record listed in the Spamhaus SBL blocklist [185.199.108.153, 185.199.111.153, 185.199.109.153, 185.199.110.153] Subject: Re: [pve-devel] [PATCH v1 installer 08/18] auto-installer: add answer file definition X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2024 13:51:04 -0000 Some comments inline, more-or-less just a (clippy) nit. On Tue, Jan 23, 2024 at 06:00:43PM +0100, Aaron Lauterer wrote: > Signed-off-by: Aaron Lauterer > --- > proxmox-auto-installer/src/answer.rs | 147 +++++++++++++++++++++++++++ > proxmox-auto-installer/src/lib.rs | 1 + > 2 files changed, 148 insertions(+) > create mode 100644 proxmox-auto-installer/src/answer.rs > > diff --git a/proxmox-auto-installer/src/answer.rs b/proxmox-auto-installer/src/answer.rs > new file mode 100644 > index 0000000..0f6c593 > --- /dev/null > +++ b/proxmox-auto-installer/src/answer.rs > @@ -0,0 +1,147 @@ [..] > + > +impl ZfsOptions { > + pub fn new() -> ZfsOptions { > + ZfsOptions { > + ashift: None, > + arc_max: None, > + checksum: None, > + compress: None, > + copies: None, > + hdsize: None, > + } > + } > +} Can be replaced by auto-deriving `Default` and then using `::default()`. Would also save a quite a few lines. Clippy screams a bit about it anyway: warning: you should consider adding a `Default` implementation for `ZfsOptions` --> proxmox-auto-installer/src/answer.rs:82:5 ... = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default = note: `#[warn(clippy::new_without_default)]` on by default [..] > + > +impl LvmOptions { > + pub fn new() -> LvmOptions { > + LvmOptions { > + hdsize: None, > + swapsize: None, > + maxroot: None, > + maxvz: None, > + minfree: None, > + } > + } > +} ^ Same here about auto-deriving `Default`. > + > +#[derive(Clone, Deserialize, Serialize, Debug)] > +pub struct BtrfsOptions { > + pub hdsize: Option, > +} > + > +impl BtrfsOptions { > + pub fn new() -> BtrfsOptions { > + BtrfsOptions { hdsize: None } > + } > +} ^ Same here about auto-deriving `Default`. > diff --git a/proxmox-auto-installer/src/lib.rs b/proxmox-auto-installer/src/lib.rs > index e69de29..7813b98 100644 > --- a/proxmox-auto-installer/src/lib.rs > +++ b/proxmox-auto-installer/src/lib.rs > @@ -0,0 +1 @@ > +pub mod answer; > -- > 2.39.2 > > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > >