mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-31 13:12:37 +00:00
Keep amount of unsafe code a bit smaller for the GstStream* stream IDs
This commit is contained in:
parent
2ec438e5b8
commit
974a689fd7
1 changed files with 4 additions and 10 deletions
|
@ -100,11 +100,8 @@ impl Stream {
|
|||
fn gst_stream_get_stream_id(collection: *mut c_void) -> *mut c_char;
|
||||
}
|
||||
|
||||
unsafe {
|
||||
CStr::from_ptr(gst_stream_get_stream_id(self.0))
|
||||
.to_str()
|
||||
.unwrap()
|
||||
}
|
||||
let cstr = unsafe { CStr::from_ptr(gst_stream_get_stream_id(self.0)) };
|
||||
cstr.to_str().unwrap()
|
||||
}
|
||||
|
||||
pub fn get_tags(&self) -> Option<TagList> {
|
||||
|
@ -213,11 +210,8 @@ impl StreamCollection {
|
|||
fn gst_stream_collection_get_upstream_id(collection: *mut c_void) -> *mut c_char;
|
||||
}
|
||||
|
||||
unsafe {
|
||||
CStr::from_ptr(gst_stream_collection_get_upstream_id(self.0))
|
||||
.to_str()
|
||||
.unwrap()
|
||||
}
|
||||
let cstr = unsafe { CStr::from_ptr(gst_stream_collection_get_upstream_id(self.0)) };
|
||||
cstr.to_str().unwrap()
|
||||
}
|
||||
|
||||
pub unsafe fn as_ptr(&self) -> *const c_void {
|
||||
|
|
Loading…
Reference in a new issue