Revert "Event/Message::get_structure() can return None"

This reverts commit aa275d5ddb.

It actually breaks the API, we need to find another way.
This commit is contained in:
Sebastian Dröge 2017-12-01 16:08:12 +02:00
parent aa275d5ddb
commit 927b1ac822
2 changed files with 4 additions and 12 deletions

View file

@ -101,14 +101,10 @@ impl EventRef {
}
pub fn get_structure(&self) -> Option<&StructureRef> {
pub fn get_structure(&self) -> &StructureRef {
unsafe {
let structure = ffi::gst_event_get_structure(self.as_mut_ptr());
if structure.is_null() {
None
} else {
Some(StructureRef::from_glib_borrow(structure))
}
StructureRef::from_glib_borrow(structure)
}
}

View file

@ -45,14 +45,10 @@ impl MessageRef {
unsafe { ffi::gst_message_get_seqnum(self.as_mut_ptr()) }
}
pub fn get_structure(&self) -> Option<&StructureRef> {
pub fn get_structure(&self) -> &StructureRef {
unsafe {
let structure = ffi::gst_message_get_structure(self.as_mut_ptr());
if structure.is_null() {
None
} else {
Some(StructureRef::from_glib_borrow(structure))
}
StructureRef::from_glib_borrow(structure)
}
}