From 6f6ad2b2eec9dbc9b3a1b0190d4a2dfd3c0b3bf6 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Tue, 16 May 2023 08:57:39 +0300 Subject: Update clap to v4.2.7 Fixes #6879. Fixes #6874. --- alacritty_config_derive/src/config_deserialize/de_enum.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'alacritty_config_derive/src/config_deserialize/de_enum.rs') diff --git a/alacritty_config_derive/src/config_deserialize/de_enum.rs b/alacritty_config_derive/src/config_deserialize/de_enum.rs index 56a2f7ba..f94977ae 100644 --- a/alacritty_config_derive/src/config_deserialize/de_enum.rs +++ b/alacritty_config_derive/src/config_deserialize/de_enum.rs @@ -1,6 +1,7 @@ use proc_macro::TokenStream; use proc_macro2::TokenStream as TokenStream2; use quote::{format_ident, quote}; +use syn::meta::ParseNestedMeta; use syn::{DataEnum, Generics, Ident}; use crate::serde_replace; @@ -14,7 +15,14 @@ pub fn derive_deserialize(ident: Ident, generics: Generics, data_enum: DataEnum) for variant in data_enum.variants.iter().filter(|variant| { // Skip deserialization for `#[config(skip)]` fields. variant.attrs.iter().all(|attr| { - !crate::path_ends_with(&attr.path, "config") || attr.tokens.to_string() != "(skip)" + let is_skip = |meta: ParseNestedMeta| { + if meta.path.is_ident("skip") { + Ok(()) + } else { + Err(meta.error("not skip")) + } + }; + !attr.path().is_ident("config") || attr.parse_nested_meta(is_skip).is_err() }) }) { let variant_ident = &variant.ident; -- cgit v1.2.3-54-g00ecf