From 4c4e74fb567abd3c11dcf373ac2c05961349c4ec Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 2 Oct 2026 15:34:06 +0300 Subject: [PATCH 1/2] feat(error): gate invalid_argument constructor behind module feature The `invalid_argument` constructor is only used by the TinyBus adapter, which is compiled only when the `module` feature is enabled. Adding a `#[cfg]` attribute prevents a dead-code warning or unused function error in builds without that feature. Auto-committed-on: dragonfly Co-authored-by: Medulla --- crates/tinymcp/src/error/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/tinymcp/src/error/mod.rs b/crates/tinymcp/src/error/mod.rs index ac431894..f1b43328 100644 --- a/crates/tinymcp/src/error/mod.rs +++ b/crates/tinymcp/src/error/mod.rs @@ -403,6 +403,10 @@ impl Error { } /// Builds a [`Self::InvalidArgument`] from anything printable. + /// + /// Only the TinyBus adapter (the `module` feature) raises this error, so the + /// constructor does not exist in a build without it. + #[cfg(any(feature = "module", test))] pub(crate) fn invalid_argument(detail: impl std::fmt::Display) -> Self { Self::InvalidArgument { detail: detail.to_string(), From ab998edbdcfe78a2695c504159b8d19ecbfbdc1a Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Fri, 2 Oct 2026 15:34:22 +0300 Subject: [PATCH 2/2] fix: gate Error::invalid_argument on the module feature that uses it Without the module feature nothing constructs InvalidArgument, so the constructor tripped dead_code. Compile it only with the adapter (and tests). Co-authored-by: Medulla --- crates/tinymcp/src/error/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/tinymcp/src/error/mod.rs b/crates/tinymcp/src/error/mod.rs index f1b43328..11e47810 100644 --- a/crates/tinymcp/src/error/mod.rs +++ b/crates/tinymcp/src/error/mod.rs @@ -404,7 +404,7 @@ impl Error { /// Builds a [`Self::InvalidArgument`] from anything printable. /// - /// Only the TinyBus adapter (the `module` feature) raises this error, so the + /// Only the `TinyBus` adapter (the `module` feature) raises this error, so the /// constructor does not exist in a build without it. #[cfg(any(feature = "module", test))] pub(crate) fn invalid_argument(detail: impl std::fmt::Display) -> Self {