diff --git a/gstreamer/src/message.rs b/gstreamer/src/message.rs index 5df97fa2f..5ff7b8ec6 100644 --- a/gstreamer/src/message.rs +++ b/gstreamer/src/message.rs @@ -388,6 +388,12 @@ impl Error { } } +impl std::fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.error()) + } +} + declare_concrete_message!(Warning, T); impl Warning { #[doc(alias = "gst_message_new_warning")] @@ -458,6 +464,12 @@ impl Warning { } } +impl std::fmt::Display for Warning { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.error()) + } +} + declare_concrete_message!(Info, T); impl Info { #[doc(alias = "gst_message_new_info")] @@ -528,6 +540,12 @@ impl Info { } } +impl std::fmt::Display for Info { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.error()) + } +} + declare_concrete_message!(Tag, T); impl Tag { #[doc(alias = "gst_message_new_tag")]