gstreamer: Implement From<T> for Signed<T>

This makes usage simpler in a few places.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1150>
This commit is contained in:
Sebastian Dröge 2022-11-18 12:07:13 +02:00
parent 77fd187986
commit 774fafd987

View file

@ -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) => {