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 D3B181FF391 for ; Thu, 27 Jun 2024 12:51:07 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D7F9C139B3; Thu, 27 Jun 2024 12:51:17 +0200 (CEST) Date: Thu, 27 Jun 2024 12:50:44 +0200 From: Gabriel Goller To: Proxmox VE development discussion Message-ID: <20240627105044.6uyrkrq4olyoxvhs@luna.proxmox.com> References: <20240626121550.292290-1-s.hanreich@proxmox.com> <20240626121550.292290-8-s.hanreich@proxmox.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240626121550.292290-8-s.hanreich@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL -0.057 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 07/21] firewall: guest: derive traits according to rust api guidelines 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: >diff --git a/proxmox-ve-config/src/guest/types.rs b/proxmox-ve-config/src/guest/types.rs >index 217c537..767ff27 100644 >--- a/proxmox-ve-config/src/guest/types.rs >+++ b/proxmox-ve-config/src/guest/types.rs >@@ -1,9 +1,13 @@ > use std::fmt; > use std::str::FromStr; > >+use serde_with::{DeserializeFromStr, SerializeDisplay}; >+ Unnecessary empty line here. > use anyhow::{format_err, Error}; > >-#[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Ord, Hash)] >+#[derive( >+ Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Ord, Hash, SerializeDisplay, DeserializeFromStr, >+)] > pub struct Vmid(u32); > > impl Vmid { >@@ -34,5 +38,3 @@ impl FromStr for Vmid { > )) > } > } >- >-serde_plain::derive_deserialize_from_fromstr!(Vmid, "valid vmid"); >diff --git a/proxmox-ve-config/src/guest/vm.rs b/proxmox-ve-config/src/guest/vm.rs >index 5b5866a..a7ea9bb 100644 >--- a/proxmox-ve-config/src/guest/vm.rs >+++ b/proxmox-ve-config/src/guest/vm.rs >@@ -5,12 +5,12 @@ use std::str::FromStr; > use std::{collections::HashMap, net::Ipv6Addr}; > > use proxmox_schema::property_string::PropertyIterator; >+use serde_with::DeserializeFromStr; Add linebreak between proxmox* imports and third-party imports (Also while you're at it, you can also pull down the anyhow import) > > use crate::firewall::parse::{match_digits, parse_bool}; > use crate::firewall::types::address::{Ipv4Cidr, Ipv6Cidr}; > >-#[derive(Debug)] >-#[cfg_attr(test, derive(Eq, PartialEq))] >+#[derive(Clone, Debug, DeserializeFromStr, PartialEq, Eq, Hash, PartialOrd, Ord)] > pub struct MacAddress([u8; 6]); > > static LOCAL_PART: [u8; 8] = [0xFE, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]; _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel