From 2d0aae4b2d595ced100f7a2ec8d13b872a5eb65e Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 10 Aug 2026 16:19:45 +0800 Subject: refactor: simplify macro parsing code and fix clippy warnings --- mingling_macros/src/func/pack_err.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mingling_macros/src/func/pack_err.rs') diff --git a/mingling_macros/src/func/pack_err.rs b/mingling_macros/src/func/pack_err.rs index 8b224b0..dcfcf86 100644 --- a/mingling_macros/src/func/pack_err.rs +++ b/mingling_macros/src/func/pack_err.rs @@ -4,9 +4,9 @@ use quote::quote; use syn::{Ident, Token, Type, parse_macro_input}; enum PackErrInput { - /// pack_err!(ErrorNotFound) + /// `pack_err!(ErrorNotFound)` Simple { type_name: Ident }, - /// pack_err!(ErrorNotDir = PathBuf) + /// `pack_err!(ErrorNotDir = PathBuf)` Typed { type_name: Ident, inner_type: Box, @@ -20,12 +20,12 @@ impl syn::parse::Parse for PackErrInput { if input.peek(Token![=]) { input.parse::()?; let inner_type: Type = input.parse()?; - Ok(PackErrInput::Typed { + Ok(Self::Typed { type_name, inner_type: Box::new(inner_type), }) } else { - Ok(PackErrInput::Simple { type_name }) + Ok(Self::Simple { type_name }) } } } -- cgit