]> git.proxmox.com Git - proxmox.git/commitdiff
api-macro: rename SerdeAttrib to FieldAttrib
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 6 Dec 2023 12:52:27 +0000 (13:52 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 6 Dec 2023 13:39:47 +0000 (14:39 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
proxmox-api-macro/src/api/enums.rs
proxmox-api-macro/src/api/structs.rs
proxmox-api-macro/src/serde.rs

index 879100bb27bad0e284b78b5c942f9449add93717..16dbbe7b30290cd7540b784013cfb64e97ec7f6c 100644 (file)
@@ -57,7 +57,7 @@ pub fn handle_enum(
             comment = "<missing description>".to_string();
         }
 
-        let attrs = serde::SerdeAttrib::try_from(&variant.attrs[..])?;
+        let attrs = serde::FieldAttrib::try_from(&variant.attrs[..])?;
         let variant_string = if let Some(renamed) = attrs.rename {
             renamed
         } else if let Some(rename_all) = container_attrs.rename_all {
index 459d47593fb3946920eeb3529ec65627c9ebe019..edd1bc1162fc7b7c4ca7567e5339395b197e70ea 100644 (file)
@@ -160,7 +160,7 @@ fn handle_regular_struct(
 
     if let syn::Fields::Named(ref fields) = &stru.fields {
         for field in &fields.named {
-            let attrs = serde::SerdeAttrib::try_from(&field.attrs[..])?;
+            let attrs = serde::FieldAttrib::try_from(&field.attrs[..])?;
 
             let (name, span) = {
                 let ident: &Ident = field
index c3148a086b7656562ba1f2fd576c375494da946b..4cb21ce795e1956718e8b7b6261ad633fcbdd733 100644 (file)
@@ -168,12 +168,12 @@ impl TryFrom<&[syn::Attribute]> for ContainerAttrib {
 
 /// `serde` field/variant attributes we support
 #[derive(Default)]
-pub struct SerdeAttrib {
+pub struct FieldAttrib {
     pub rename: Option<syn::LitStr>,
     pub flatten: bool,
 }
 
-impl SerdeAttrib {
+impl FieldAttrib {
     pub fn parse_attribute(&mut self, attrib: &syn::Attribute) -> Result<(), syn::Error> {
         let list = match &attrib.meta {
             syn::Meta::List(list) if list.path.is_ident("serde") => list,
@@ -207,7 +207,7 @@ impl SerdeAttrib {
     }
 }
 
-impl TryFrom<&[syn::Attribute]> for SerdeAttrib {
+impl TryFrom<&[syn::Attribute]> for FieldAttrib {
     type Error = syn::Error;
 
     fn try_from(attributes: &[syn::Attribute]) -> Result<Self, syn::Error> {