Skip to content

Commit 2672924

Browse files
committed
fix: resolve clippy warnings in mcp_tool.rs
1 parent a19d969 commit 2672924

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

mcp-macros/src/mcp_tool.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ use crate::utils::*;
1111
#[derive(Clone)]
1212
struct ResourceInfo {
1313
method_name: syn::Ident,
14+
#[allow(dead_code)]
1415
resource_name: String,
16+
#[allow(dead_code)]
1517
description: String,
18+
#[allow(dead_code)]
1619
uri_template: String,
1720
path_pattern: String,
1821
param_names: Vec<String>,
@@ -31,7 +34,7 @@ fn parse_uri_template(uri_template: &str) -> (String, Vec<String>) {
3134
// treat everything after :// as the path since there's no host part
3235
// Add leading slash to make it a proper matchit path
3336
return (
34-
format!("/{}", after_scheme),
37+
format!("/{after_scheme}"),
3538
extract_uri_parameters(after_scheme),
3639
);
3740
} else {
@@ -41,7 +44,7 @@ fn parse_uri_template(uri_template: &str) -> (String, Vec<String>) {
4144
} else {
4245
// Add leading slash
4346
return (
44-
format!("/{}", uri_template),
47+
format!("/{uri_template}"),
4548
extract_uri_parameters(uri_template),
4649
);
4750
}
@@ -58,7 +61,7 @@ fn extract_uri_parameters(path: &str) -> Vec<String> {
5861
while let Some(ch) = chars.next() {
5962
if ch == '{' {
6063
let mut param_name = String::new();
61-
while let Some(ch) = chars.next() {
64+
for ch in chars.by_ref() {
6265
if ch == '}' {
6366
break;
6467
}

0 commit comments

Comments
 (0)