Skip to content

Commit 75a7e48

Browse files
authored
docs(macro): fix visibility attribute's usage of handler macro (#481)
1 parent b749e3c commit 75a7e48

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

crates/rmcp-macros/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Or specify the visibility and router name, which would be helpful when you want
7272

7373
```rust
7474
mod a {
75-
#[tool_router(router = tool_router_a, vis = pub)]
75+
#[tool_router(router = tool_router_a, vis = "pub")]
7676
impl MyToolHandler {
7777
#[tool]
7878
fn my_tool_a() {
@@ -82,7 +82,7 @@ mod a {
8282
}
8383

8484
mod b {
85-
#[tool_router(router = tool_router_b, vis = pub)]
85+
#[tool_router(router = tool_router_b, vis = "pub")]
8686
impl MyToolHandler {
8787
#[tool]
8888
fn my_tool_b() {

crates/rmcp-macros/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub fn tool(attr: TokenStream, input: TokenStream) -> TokenStream {
7575
///
7676
/// ```rust,ignore
7777
/// mod a {
78-
/// #[tool_router(router = tool_router_a, vis = pub)]
78+
/// #[tool_router(router = tool_router_a, vis = "pub")]
7979
/// impl MyToolHandler {
8080
/// #[tool]
8181
/// fn my_tool_a() {
@@ -85,7 +85,7 @@ pub fn tool(attr: TokenStream, input: TokenStream) -> TokenStream {
8585
/// }
8686
///
8787
/// mod b {
88-
/// #[tool_router(router = tool_router_b, vis = pub)]
88+
/// #[tool_router(router = tool_router_b, vis = "pub")]
8989
/// impl MyToolHandler {
9090
/// #[tool]
9191
/// fn my_tool_b() {

crates/rmcp-macros/src/tool_router.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ mod test {
7676
fn test_router_attr() -> Result<(), Box<dyn std::error::Error>> {
7777
let attr = quote! {
7878
router = test_router,
79+
vis = "pub(crate)"
7980
};
8081
let attr_args = NestedMeta::parse_meta_list(attr)?;
8182
let ToolRouterAttribute { router, vis } = ToolRouterAttribute::from_list(&attr_args)?;

0 commit comments

Comments
 (0)