From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 963841FF19B for ; Fri, 21 Feb 2025 13:45:41 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 01C0CF9F; Fri, 21 Feb 2025 13:45:40 +0100 (CET) Message-ID: <0ec7727e-a9e3-421a-92e3-cfcb54b0703c@proxmox.com> Date: Fri, 21 Feb 2025 13:45:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Proxmox Backup Server development discussion , Shannon Sterz , Maximiliano Sandoval References: <20250221091320.116823-1-m.sandoval@proxmox.com> Content-Language: de-AT, en-US From: Lukas Wagner In-Reply-To: X-SPAM-LEVEL: Spam detection results: 0 AWL 0.010 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 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pbs-devel] [PATCH backup] pull_metrics: Rename argument called gen to point 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" On 2025-02-21 13:40, Shannon Sterz wrote: > On Fri Feb 21, 2025 at 10:13 AM CET, Maximiliano Sandoval wrote: >> gen is a reserved keyword in the rust 2024 edition. See >> https://doc.rust-lang.org/edition-guide/rust-2024/gen-keyword.html. >> >> Signed-off-by: Maximiliano Sandoval >> --- >> src/server/metric_collection/pull_metrics.rs | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/src/server/metric_collection/pull_metrics.rs b/src/server/metric_collection/pull_metrics.rs >> index 1b5f3777..4d732071 100644 >> --- a/src/server/metric_collection/pull_metrics.rs >> +++ b/src/server/metric_collection/pull_metrics.rs >> @@ -73,9 +73,9 @@ pub fn get_all_metrics(start_time: i64) -> Result, Error> { >> >> let mut points = Vec::new(); >> >> - for gen in cached_datapoints { >> - if gen.timestamp > start_time { >> - points.extend(gen.datapoints); >> + for point in cached_datapoints { >> + if point.timestamp > start_time { >> + points.extend(point.datapoints); > > tiny nit: i'm guessing `gen` was short for `generation`, as in cache generation? > maybe use `generation` instead. `point.datapoints` reads akwardly to > me. > +1 `point` reads weird, since it is indeed a collection (or generation) of metric datapoints, not a single point. I'd also suggest calling it `generation`. -- - Lukas _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel