From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 864891FF15F for ; Mon, 2 Dec 2024 14:10:36 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 56F0117F79; Mon, 2 Dec 2024 14:10:42 +0100 (CET) From: Maximiliano Sandoval To: pbs-devel@lists.proxmox.com Date: Mon, 2 Dec 2024 14:10:07 +0100 Message-Id: <20241202131008.410529-2-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241202131008.410529-1-m.sandoval@proxmox.com> References: <20241202131008.410529-1-m.sandoval@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 1 AWL 0.057 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.001 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/) RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_SBL_A 0.1 Contains URL's A record listed in the Spamhaus SBL blocklist [185.199.111.153, 185.199.109.153, 185.199.108.153, 185.199.110.153] Subject: [pbs-devel] [PATCH backup 2/3] chunker: do not reassign context's total field 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" ``` warning: field assignment outside of initializer for an instance created with Default::default() --> pbs-datastore/src/chunker.rs:431:5 | 431 | ctx.total = buffer.len() as u64; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: consider initializing the variable with `chunker::Context { total: buffer.len() as u64, ..Default::default() }` and removing relevant reassignments --> pbs-datastore/src/chunker.rs:430:5 | 430 | let mut ctx = Context::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default = note: `#[warn(clippy::field_reassign_with_default)]` on by default ``` Signed-off-by: Maximiliano Sandoval --- pbs-datastore/src/chunker.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pbs-datastore/src/chunker.rs b/pbs-datastore/src/chunker.rs index bf1e8d8df..f6892e086 100644 --- a/pbs-datastore/src/chunker.rs +++ b/pbs-datastore/src/chunker.rs @@ -427,8 +427,10 @@ fn test_suggested_boundary() { chunks1.push((last, buffer.len() - last)); let mut pos = 0; - let mut ctx = Context::default(); - ctx.total = buffer.len() as u64; + let mut ctx = Context { + total: buffer.len() as u64, + ..Default::default() + }; chunker.reset(); // Suggest chunk boundary within regular chunk tx.send(32 * 1024).unwrap(); -- 2.39.5 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel