Skip to content

Commit 0b53bfd

Browse files
authored
fix: remove unnecessary doc-cfg (#661)
1 parent 5a6ff1f commit 0b53bfd

11 files changed

Lines changed: 0 additions & 48 deletions

File tree

crates/rmcp/src/handler.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#[cfg(feature = "client")]
2-
#[cfg_attr(docsrs, doc(cfg(feature = "client")))]
32
pub mod client;
43
#[cfg(feature = "server")]
5-
#[cfg_attr(docsrs, doc(cfg(feature = "server")))]
64
pub mod server;

crates/rmcp/src/lib.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,18 @@ pub use error::{Error, ErrorData, RmcpError};
99
/// Basic data types in MCP specification
1010
pub mod model;
1111
#[cfg(any(feature = "client", feature = "server"))]
12-
#[cfg_attr(docsrs, doc(cfg(any(feature = "client", feature = "server"))))]
1312
pub mod service;
1413
#[cfg(feature = "client")]
15-
#[cfg_attr(docsrs, doc(cfg(feature = "client")))]
1614
pub use handler::client::ClientHandler;
1715
#[cfg(feature = "server")]
18-
#[cfg_attr(docsrs, doc(cfg(feature = "server")))]
1916
pub use handler::server::ServerHandler;
2017
#[cfg(feature = "server")]
21-
#[cfg_attr(docsrs, doc(cfg(feature = "server")))]
2218
pub use handler::server::wrapper::Json;
2319
#[cfg(any(feature = "client", feature = "server"))]
24-
#[cfg_attr(docsrs, doc(cfg(any(feature = "client", feature = "server"))))]
2520
pub use service::{Peer, Service, ServiceError, ServiceExt};
2621
#[cfg(feature = "client")]
27-
#[cfg_attr(docsrs, doc(cfg(feature = "client")))]
2822
pub use service::{RoleClient, serve_client};
2923
#[cfg(feature = "server")]
30-
#[cfg_attr(docsrs, doc(cfg(feature = "server")))]
3124
pub use service::{RoleServer, serve_server};
3225

3326
pub mod handler;
@@ -36,17 +29,12 @@ pub mod transport;
3629

3730
// re-export
3831
#[cfg(all(feature = "macros", feature = "server"))]
39-
#[cfg_attr(docsrs, doc(cfg(all(feature = "macros", feature = "server"))))]
4032
pub use pastey::paste;
4133
#[cfg(all(feature = "macros", feature = "server"))]
42-
#[cfg_attr(docsrs, doc(cfg(all(feature = "macros", feature = "server"))))]
4334
pub use rmcp_macros::*;
4435
#[cfg(any(feature = "macros", feature = "server"))]
45-
#[cfg_attr(docsrs, doc(cfg(any(feature = "macros", feature = "server"))))]
4636
pub use schemars;
4737
#[cfg(feature = "macros")]
48-
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
4938
pub use serde;
5039
#[cfg(feature = "macros")]
51-
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
5240
pub use serde_json;

crates/rmcp/src/model.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ pub fn object(value: serde_json::Value) -> JsonObject {
4343

4444
/// Use this macro just like [`serde_json::json!`]
4545
#[cfg(feature = "macros")]
46-
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
4746
#[macro_export]
4847
macro_rules! object {
4948
({$($tt:tt)*}) => {

crates/rmcp/src/service.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,17 @@ use crate::{
1111
transport::{DynamicTransportError, IntoTransport, Transport},
1212
};
1313
#[cfg(feature = "client")]
14-
#[cfg_attr(docsrs, doc(cfg(feature = "client")))]
1514
mod client;
1615
#[cfg(feature = "client")]
17-
#[cfg_attr(docsrs, doc(cfg(feature = "client")))]
1816
pub use client::*;
1917
#[cfg(feature = "server")]
20-
#[cfg_attr(docsrs, doc(cfg(feature = "server")))]
2118
mod server;
2219
#[cfg(feature = "server")]
23-
#[cfg_attr(docsrs, doc(cfg(feature = "server")))]
2420
pub use server::*;
2521
#[cfg(feature = "tower")]
26-
#[cfg_attr(docsrs, doc(cfg(feature = "tower")))]
2722
mod tower;
2823
use tokio_util::sync::{CancellationToken, DropGuard};
2924
#[cfg(feature = "tower")]
30-
#[cfg_attr(docsrs, doc(cfg(feature = "tower")))]
3125
pub use tower::*;
3226
use tracing::{Instrument as _, instrument};
3327
#[derive(Error, Debug)]

crates/rmcp/src/transport.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,10 @@
4343
//! # ServiceExt, serve_server,
4444
//! # };
4545
//! #[cfg(feature = "client")]
46-
//! #[cfg_attr(docsrs, doc(cfg(feature = "client")))]
4746
//! # use rmcp::serve_client;
4847
//!
4948
//! // create transport from tcp stream
5049
//! #[cfg(feature = "client")]
51-
//! #[cfg_attr(docsrs, doc(cfg(feature = "client")))]
5250
//! async fn client() -> Result<(), Box<dyn std::error::Error>> {
5351
//! let stream = tokio::net::TcpSocket::new_v4()?
5452
//! .connect("127.0.0.1:8001".parse()?)
@@ -61,7 +59,6 @@
6159
//!
6260
//! // create transport from std io
6361
//! #[cfg(feature = "client")]
64-
//! #[cfg_attr(docsrs, doc(cfg(feature = "client")))]
6562
//! async fn io() -> Result<(), Box<dyn std::error::Error>> {
6663
//! let client = ().serve((tokio::io::stdin(), tokio::io::stdout())).await?;
6764
//! let tools = client.peer().list_tools(Default::default()).await?;
@@ -77,56 +74,42 @@ use crate::service::{RxJsonRpcMessage, ServiceRole, TxJsonRpcMessage};
7774
pub mod sink_stream;
7875

7976
#[cfg(feature = "transport-async-rw")]
80-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-async-rw")))]
8177
pub mod async_rw;
8278

8379
#[cfg(feature = "transport-worker")]
84-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-worker")))]
8580
pub mod worker;
8681
#[cfg(feature = "transport-worker")]
87-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-worker")))]
8882
pub use worker::WorkerTransport;
8983

9084
#[cfg(feature = "transport-child-process")]
91-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-child-process")))]
9285
pub mod child_process;
9386
#[cfg(feature = "transport-child-process")]
94-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-child-process")))]
9587
pub use child_process::{ConfigureCommandExt, TokioChildProcess};
9688

9789
#[cfg(feature = "transport-io")]
98-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-io")))]
9990
pub mod io;
10091
#[cfg(feature = "transport-io")]
101-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-io")))]
10292
pub use io::stdio;
10393

10494
#[cfg(feature = "auth")]
105-
#[cfg_attr(docsrs, doc(cfg(feature = "auth")))]
10695
pub mod auth;
10796
#[cfg(feature = "auth")]
108-
#[cfg_attr(docsrs, doc(cfg(feature = "auth")))]
10997
pub use auth::{
11098
AuthClient, AuthError, AuthorizationManager, AuthorizationSession, AuthorizedHttpClient,
11199
CredentialStore, InMemoryCredentialStore, InMemoryStateStore, ScopeUpgradeConfig, StateStore,
112100
StoredAuthorizationState, StoredCredentials, WWWAuthenticateParams,
113101
};
114102

115103
// #[cfg(feature = "transport-ws")]
116-
// #[cfg_attr(docsrs, doc(cfg(feature = "transport-ws")))]
117104
// pub mod ws;
118105
#[cfg(feature = "transport-streamable-http-server-session")]
119-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-streamable-http-server-session")))]
120106
pub mod streamable_http_server;
121107
#[cfg(feature = "transport-streamable-http-server")]
122-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-streamable-http-server")))]
123108
pub use streamable_http_server::tower::{StreamableHttpServerConfig, StreamableHttpService};
124109

125110
#[cfg(feature = "transport-streamable-http-client")]
126-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-streamable-http-client")))]
127111
pub mod streamable_http_client;
128112
#[cfg(feature = "transport-streamable-http-client")]
129-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-streamable-http-client")))]
130113
pub use streamable_http_client::StreamableHttpClientTransport;
131114

132115
/// Common use codes

crates/rmcp/src/transport/async_rw.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ where
6868
}
6969

7070
#[cfg(feature = "client")]
71-
#[cfg_attr(docsrs, doc(cfg(feature = "client")))]
7271
impl<R, W> AsyncRwTransport<crate::RoleClient, R, W>
7372
where
7473
R: Send + AsyncRead + Unpin,
@@ -80,7 +79,6 @@ where
8079
}
8180

8281
#[cfg(feature = "server")]
83-
#[cfg_attr(docsrs, doc(cfg(feature = "server")))]
8482
impl<R, W> AsyncRwTransport<crate::RoleServer, R, W>
8583
where
8684
R: Send + AsyncRead + Unpin,

crates/rmcp/src/transport/common.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@ pub mod server_side_http;
44
pub mod http_header;
55

66
#[cfg(feature = "__reqwest")]
7-
#[cfg_attr(docsrs, doc(cfg(feature = "reqwest")))]
87
mod reqwest;
98

109
// Note: This module provides SSE stream parsing and auto-reconnect utilities.
1110
// It's used by the streamable HTTP client (which receives SSE-formatted responses),
1211
// not the removed SSE transport. The name is historical.
1312
#[cfg(feature = "client-side-sse")]
14-
#[cfg_attr(docsrs, doc(cfg(feature = "client-side-sse")))]
1513
pub mod client_side_sse;
1614

1715
#[cfg(feature = "auth")]
18-
#[cfg_attr(docsrs, doc(cfg(feature = "auth")))]
1916
pub mod auth;
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
#[cfg(feature = "transport-streamable-http-client")]
2-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-streamable-http-client")))]
32
mod streamable_http_client;
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
#[cfg(feature = "transport-streamable-http-client-reqwest")]
2-
#[cfg_attr(docsrs, doc(cfg(feature = "transport-streamable-http-client-reqwest")))]
32
mod streamable_http_client;

crates/rmcp/src/transport/streamable_http_client.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ pub enum StreamableHttpError<E: std::error::Error + Send + Sync + 'static> {
7070
#[error("Missing session id in HTTP response")]
7171
MissingSessionIdInResponse,
7272
#[cfg(feature = "auth")]
73-
#[cfg_attr(docsrs, doc(cfg(feature = "auth")))]
7473
#[error("Auth error: {0}")]
7574
Auth(#[from] crate::transport::auth::AuthError),
7675
#[error("Auth required")]

0 commit comments

Comments
 (0)