diff --git a/src/providers/whatsapp_shared/error.rs b/src/providers/whatsapp_shared/error.rs index 4b1fb028c..58feecdab 100644 --- a/src/providers/whatsapp_shared/error.rs +++ b/src/providers/whatsapp_shared/error.rs @@ -11,6 +11,10 @@ pub(crate) enum WaFailure { /// Refused before any provider call: bad scope, missing port, invalid input. Rejected(String), /// The input cannot be represented by this provider's address format. + /// + /// Only the Web adapter builds this class; the Cloud API adapter just + /// handles it. + #[cfg_attr(not(any(test, feature = "whatsapp-web")), allow(dead_code))] BadFormat(String), /// The adapter or protocol cannot carry this content or operation. Unsupported(String), @@ -35,6 +39,7 @@ impl WaFailure { Self::Rejected(message.into()) } + #[cfg(any(test, feature = "whatsapp-web"))] pub(crate) fn bad_format(message: impl Into) -> Self { Self::BadFormat(message.into()) } diff --git a/src/providers/whatsapp_shared/window.rs b/src/providers/whatsapp_shared/window.rs index 7e1fa8674..ad5097946 100644 --- a/src/providers/whatsapp_shared/window.rs +++ b/src/providers/whatsapp_shared/window.rs @@ -76,8 +76,10 @@ impl BoundedMap { /// aborted. A listener that parks keeps its inbound sender in such a slot; if /// the slot outlived the listener the module's inbound forwarder would never /// see its channel close and provider shutdown would wait forever. +#[cfg(any(test, feature = "whatsapp-web"))] pub(crate) struct ClearOnDrop<'a, T>(pub(crate) &'a parking_lot::Mutex>); +#[cfg(any(test, feature = "whatsapp-web"))] impl Drop for ClearOnDrop<'_, T> { fn drop(&mut self) { *self.0.lock() = None;