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 9508D95C99 for ; Wed, 28 Feb 2024 12:39:24 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 74838AA57 for ; Wed, 28 Feb 2024 12:39:24 +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, 28 Feb 2024 12:39:23 +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 CFA1647BF5 for ; Wed, 28 Feb 2024 12:39:22 +0100 (CET) From: Maximiliano Sandoval To: pbs-devel@lists.proxmox.com Date: Wed, 28 Feb 2024 12:39:20 +0100 Message-Id: <20240228113920.302844-6-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240228113920.302844-1-m.sandoval@proxmox.com> References: <20240228113920.302844-1-m.sandoval@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 1 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 FSL_BULK_SIG 0.687 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 - Subject: [pbs-devel] [PATCH proxmox 6/6] rrd: use unwrap_or_default when possible 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: Wed, 28 Feb 2024 11:39:24 -0000 Fixes the Clippy warnings: warning: use of `unwrap_or_else` to construct default value --> proxmox-rrd/src/cache.rs:65:41 | 65 | let file_options = file_options.unwrap_or_else(CreateOptions::new); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default = note: `#[warn(clippy::unwrap_or_default)]` on by default warning: use of `unwrap_or_else` to construct default value --> proxmox-rrd/src/cache.rs:66:39 | 66 | let dir_options = dir_options.unwrap_or_else(CreateOptions::new); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default Signed-off-by: Maximiliano Sandoval --- proxmox-rrd/src/cache.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxmox-rrd/src/cache.rs b/proxmox-rrd/src/cache.rs index e3d2f8d5..5b123a6b 100644 --- a/proxmox-rrd/src/cache.rs +++ b/proxmox-rrd/src/cache.rs @@ -62,8 +62,8 @@ impl Cache { ) -> Result { let basedir = basedir.as_ref().to_owned(); - let file_options = file_options.unwrap_or_else(CreateOptions::new); - let dir_options = dir_options.unwrap_or_else(CreateOptions::new); + let file_options = file_options.unwrap_or_default(); + let dir_options = dir_options.unwrap_or_default(); create_path( &basedir, -- 2.39.2