diff --git a/gstreamer/src/promise.rs b/gstreamer/src/promise.rs index 22bb2ad62..6afbbeb26 100644 --- a/gstreamer/src/promise.rs +++ b/gstreamer/src/promise.rs @@ -150,7 +150,6 @@ unsafe impl Sync for Promise {} #[derive(Debug)] pub struct PromiseFuture(Promise, futures_channel::oneshot::Receiver<()>); -#[derive(Debug)] pub struct PromiseReply(Promise); impl std::future::Future for PromiseFuture { @@ -196,6 +195,18 @@ impl Deref for PromiseReply { } } +impl std::fmt::Debug for PromiseReply { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let mut debug = f.debug_tuple("PromiseReply"); + + match self.0.get_reply() { + Some(reply) => debug.field(reply), + None => debug.field(&""), + } + .finish() + } +} + #[cfg(test)] mod tests { use super::*;