From 0ad594277e61e9fb41b2e470c34cff7534d6c780 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sun, 14 Sep 2025 13:12:27 +0800 Subject: Fixed codes by Zed --- crates/utils/cfg_file/cfg_file_derive/src/lib.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'crates/utils/cfg_file/cfg_file_derive/src/lib.rs') diff --git a/crates/utils/cfg_file/cfg_file_derive/src/lib.rs b/crates/utils/cfg_file/cfg_file_derive/src/lib.rs index c43fd59..66a6d6f 100644 --- a/crates/utils/cfg_file/cfg_file_derive/src/lib.rs +++ b/crates/utils/cfg_file/cfg_file_derive/src/lib.rs @@ -3,11 +3,7 @@ extern crate proc_macro; use proc_macro::TokenStream; use quote::quote; use syn::parse::ParseStream; -use syn::{ - parse_macro_input, - DeriveInput, - Attribute -}; +use syn::{Attribute, DeriveInput, parse_macro_input}; #[proc_macro_derive(ConfigFile, attributes(cfg_file))] pub fn derive_config_file(input: TokenStream) -> TokenStream { @@ -55,9 +51,13 @@ fn find_cfg_file_path(attrs: &[Attribute]) -> Option { let parser = |meta: ParseStream| { let path_meta: syn::MetaNameValue = meta.parse()?; if path_meta.path.is_ident("path") - && let syn::Expr::Lit(syn::ExprLit { lit: syn::Lit::Str(lit), .. }) = path_meta.value { - return Ok(lit.value()); - } + && let syn::Expr::Lit(syn::ExprLit { + lit: syn::Lit::Str(lit), + .. + }) = path_meta.value + { + return Ok(lit.value()); + } Err(meta.error("expected `path = \"...\"`")) }; @@ -82,4 +82,4 @@ fn to_snake_case(s: &str) -> String { } } snake -} \ No newline at end of file +} -- cgit