|
1 | 1 | use darling::{FromMeta, ast::NestedMeta}; |
2 | 2 | use proc_macro2::TokenStream; |
3 | | -use quote::{ToTokens, format_ident, quote}; |
4 | | -use syn::{Expr, ImplItem, ItemImpl, parse_quote}; |
| 3 | +use quote::{ToTokens, quote}; |
| 4 | +use syn::{Expr, ImplItem, ItemImpl}; |
5 | 5 |
|
6 | 6 | use crate::common::{has_method, has_sibling_handler}; |
7 | 7 |
|
@@ -82,7 +82,7 @@ pub fn skill_handler(attr: TokenStream, input: TokenStream) -> syn::Result<Token |
82 | 82 | let attr_args = NestedMeta::parse_meta_list(attr)?; |
83 | 83 | let SkillHandlerAttribute { |
84 | 84 | router, |
85 | | - meta, |
| 85 | + meta: _, |
86 | 86 | name, |
87 | 87 | version, |
88 | 88 | instructions, |
@@ -186,17 +186,15 @@ pub fn skill_handler(attr: TokenStream, input: TokenStream) -> syn::Result<Token |
186 | 186 | item_impl.items.push(directory_read_fn); |
187 | 187 | } |
188 | 188 |
|
189 | | - if !has_method("get_info", &item_impl) { |
190 | | - if !has_sibling_handler(&item_impl, "tool_handler") { |
191 | | - let get_info_fn = build_get_info( |
192 | | - &item_impl, |
193 | | - name, |
194 | | - version, |
195 | | - instructions, |
196 | | - CallerCapability::Skills, |
197 | | - )?; |
198 | | - item_impl.items.push(get_info_fn); |
199 | | - } |
| 189 | + if !has_method("get_info", &item_impl) && !has_sibling_handler(&item_impl, "tool_handler") { |
| 190 | + let get_info_fn = build_get_info( |
| 191 | + &item_impl, |
| 192 | + name, |
| 193 | + version, |
| 194 | + instructions, |
| 195 | + CallerCapability::Skills, |
| 196 | + )?; |
| 197 | + item_impl.items.push(get_info_fn); |
200 | 198 | } |
201 | 199 |
|
202 | 200 | Ok(item_impl.into_token_stream()) |
|
0 commit comments