Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/providers/whatsapp_shared/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -35,6 +39,7 @@ impl WaFailure {
Self::Rejected(message.into())
}

#[cfg(any(test, feature = "whatsapp-web"))]
pub(crate) fn bad_format(message: impl Into<String>) -> Self {
Self::BadFormat(message.into())
}
Expand Down
2 changes: 2 additions & 0 deletions src/providers/whatsapp_shared/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Option<T>>);

#[cfg(any(test, feature = "whatsapp-web"))]
impl<T> Drop for ClearOnDrop<'_, T> {
fn drop(&mut self) {
*self.0.lock() = None;
Expand Down
Loading