From 774fafd9879f8fe4c22b0b9d073b7e6ce9deb7b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 18 Nov 2022 12:07:13 +0200 Subject: [PATCH] gstreamer: Implement `From for Signed` This makes usage simpler in a few places. Part-of: --- gstreamer/src/format/macros.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gstreamer/src/format/macros.rs b/gstreamer/src/format/macros.rs index 11a642ae7..68e35bfdd 100644 --- a/gstreamer/src/format/macros.rs +++ b/gstreamer/src/format/macros.rs @@ -208,6 +208,12 @@ macro_rules! impl_unsigned_int_into_signed( Some(self?.into_negative()) } } + + impl From<$typ> for crate::Signed<$typ> { + fn from(v: $typ) -> crate::Signed<$typ> { + crate::Signed::Positive(v) + } + } }; ($typ:ty, $inner:ty) => {