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 5E38C1FF179 for ; Wed, 12 Nov 2025 15:41:33 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id AA0FA6DB1; Wed, 12 Nov 2025 15:42:20 +0100 (CET) Mime-Version: 1.0 Date: Wed, 12 Nov 2025 15:41:47 +0100 Message-Id: From: "Lukas Wagner" To: "Proxmox Datacenter Manager development discussion" , "Stefan Hanreich" X-Mailer: aerc 0.21.0-0-g5549850facc2-dirty References: <20251110172517.335741-1-h.laimer@proxmox.com> <20251110172517.335741-13-h.laimer@proxmox.com> <82ed4e5a-1fef-42cb-930c-6464f9e10aad@proxmox.com> In-Reply-To: <82ed4e5a-1fef-42cb-930c-6464f9e10aad@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1762958482629 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.030 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 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 Subject: Re: [pdm-devel] [PATCH proxmox-datacenter-manager v3 4/4] ui: add firewall status tree 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" On Wed Nov 12, 2025 at 12:21 PM CET, Stefan Hanreich wrote: >> + >> +fn sort_entries(a: &TreeEntry, b: &TreeEntry) -> Ordering { >> + let rank_a = a.sort_rank(); >> + let rank_b = b.sort_rank(); >> + match rank_a.cmp(&rank_b) { >> + Ordering::Equal => a.name().cmp(&b.name()), >> + other => other, >> + } >> +} > > maybe (a.sort_rank(), a.name()).cmp(&(b.sort_rank(), b.name())), makes > the intention clearer imo - or is a.name() expensive? > I would contest the claim that it's clearer, I actually had to look up how .cmp works for tuples just now, TIL! :D But it's more elegant and shorter, that's for sure. _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel