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 217651FF173 for ; Mon, 13 Jan 2025 15:28:46 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C457B1839; Mon, 13 Jan 2025 15:28:29 +0100 (CET) From: Maximiliano Sandoval To: pdm-devel@lists.proxmox.com Date: Mon, 13 Jan 2025 15:27:17 +0100 Message-Id: <20250113142725.523748-7-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250113142725.523748-1-m.sandoval@proxmox.com> References: <20250113142725.523748-1-m.sandoval@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.054 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 URIBL_SBL_A 0.1 Contains URL's A record listed in the Spamhaus SBL blocklist [185.199.110.153, 185.199.108.153, 185.199.111.153, 185.199.109.153] Subject: [pdm-devel] [PATCH proxmox-yew-comp 07/15] remove unnecesary closure used with then() X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" Fixes: warning: unnecessary closure used with `bool::then` --> src/rrd_graph_new.rs:950:33 | 950 | .attribute("data-show", (self.draw_cross && data_time.is_some()).then(|| "")) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default help: use `then_some` instead | 950 | .attribute("data-show", (self.draw_cross && data_time.is_some()).then_some("")) | ~~~~~~~~~~~~~ Signed-off-by: Maximiliano Sandoval --- src/rrd_graph_new.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rrd_graph_new.rs b/src/rrd_graph_new.rs index 00fa39a..426dc61 100644 --- a/src/rrd_graph_new.rs +++ b/src/rrd_graph_new.rs @@ -947,7 +947,7 @@ impl Component for PwtRRDGraph { .node_ref(self.tooltip_ref.clone()) .attribute("role", "tooltip") .attribute("aria-live", "polite") - .attribute("data-show", (self.draw_cross && data_time.is_some()).then(|| "")) + .attribute("data-show", (self.draw_cross && data_time.is_some()).then_some("")) .class("pwt-tooltip") .class("pwt-tooltip-rich") .with_optional_child(match (self.serie0_visible, &props.serie0) { @@ -981,7 +981,7 @@ impl Component for PwtRRDGraph { "pwt-rrd-legend-marker0", "fa", "fa-circle", - (!self.serie0_visible).then(|| "disabled") + (!self.serie0_visible).then_some("disabled") ); panel.add_tool( Button::new(serie0.label.clone()) @@ -993,7 +993,7 @@ impl Component for PwtRRDGraph { "pwt-rrd-legend-marker1", "fa", "fa-circle", - (!self.serie1_visible).then(|| "disabled") + (!self.serie1_visible).then_some("disabled") ); panel.add_tool( Button::new(serie1.label.clone()) -- 2.39.5 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel