On 26.06.2024 14:15, Stefan Hanreich wrote:
Signed-off-by: Stefan Hanreich <s.hanre...@proxmox.com>
---
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

Reply via email to