mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-28 19:10:34 +00:00
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:
parent
77fd187986
commit
774fafd987
1 changed files with 6 additions and 0 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue