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 EFE031FF3A0 for ; Thu, 27 Jun 2024 12:45:34 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2C5511384E; Thu, 27 Jun 2024 12:45:45 +0200 (CEST) Date: Thu, 27 Jun 2024 12:45:40 +0200 From: Gabriel Goller To: Proxmox VE development discussion Message-ID: <20240627104540.mzjwdgdgkpb5jwl3@luna.proxmox.com> References: <20240626121550.292290-1-s.hanreich@proxmox.com> <20240626121550.292290-7-s.hanreich@proxmox.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240626121550.292290-7-s.hanreich@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL -0.058 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: [pve-devel] [PATCH proxmox-ve-rs 06/21] ipset: address: add helper methods X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On 26.06.2024 14:15, Stefan Hanreich wrote: >Signed-off-by: Stefan Hanreich >--- > proxmox-ve-config/src/firewall/types/address.rs | 10 ++++++++++ > proxmox-ve-config/src/firewall/types/ipset.rs | 14 ++++++++++++++ > 2 files changed, 24 insertions(+) > >diff --git a/proxmox-ve-config/src/firewall/types/address.rs b/proxmox-ve-config/src/firewall/types/address.rs >index 3238601..962c9d2 100644 >--- a/proxmox-ve-config/src/firewall/types/address.rs >+++ b/proxmox-ve-config/src/firewall/types/address.rs >@@ -11,6 +11,16 @@ pub enum Family { > V6, > } > >+impl Family { >+ pub fn is_ipv4(&self) -> bool { >+ matches!(self, Self::V4) We don't need the `matches!` here, a `*self == Self::V4` is enough. Same below. >+ } >+ >+ pub fn is_ipv6(&self) -> bool { >+ matches!(self, Self::V6) >+ } >+} >+ > impl fmt::Display for Family { > fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { > match self { _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel