mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-22 16:16:37 +00:00
Fix various clippy warnings
This commit is contained in:
parent
c4c8e738fd
commit
09db28bbf5
9 changed files with 18 additions and 18 deletions
|
@ -32,7 +32,7 @@ impl<O: IsA<Bin>> BinExtManual for O {
|
|||
}
|
||||
}
|
||||
|
||||
return Ok(());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn remove_many<E: IsA<Element>>(&self, elements: &[&E]) -> Result<(), glib::BoolError> {
|
||||
|
@ -48,6 +48,6 @@ impl<O: IsA<Bin>> BinExtManual for O {
|
|||
}
|
||||
}
|
||||
|
||||
return Ok(());
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,41 +108,41 @@ impl GstRc<BufferRef> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn into_read_mapped_buffer(buffer: Self) -> Result<ReadMappedBuffer, Self> {
|
||||
pub fn into_read_mapped_buffer(self) -> Result<ReadMappedBuffer, Self> {
|
||||
let mut map_info: ffi::GstMapInfo = unsafe { mem::zeroed() };
|
||||
let res: bool = unsafe {
|
||||
from_glib(ffi::gst_buffer_map(
|
||||
buffer.as_mut_ptr(),
|
||||
self.as_mut_ptr(),
|
||||
&mut map_info,
|
||||
ffi::GST_MAP_READ,
|
||||
))
|
||||
};
|
||||
if res {
|
||||
Ok(ReadMappedBuffer {
|
||||
buffer: buffer,
|
||||
buffer: self,
|
||||
map_info: map_info,
|
||||
})
|
||||
} else {
|
||||
Err(buffer)
|
||||
Err(self)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn into_readwrite_mapped_buffer(buffer: Self) -> Result<ReadWriteMappedBuffer, Self> {
|
||||
pub fn into_readwrite_mapped_buffer(self) -> Result<ReadWriteMappedBuffer, Self> {
|
||||
let mut map_info: ffi::GstMapInfo = unsafe { mem::zeroed() };
|
||||
let res: bool = unsafe {
|
||||
from_glib(ffi::gst_buffer_map(
|
||||
buffer.as_mut_ptr(),
|
||||
self.as_mut_ptr(),
|
||||
&mut map_info,
|
||||
ffi::GST_MAP_READWRITE,
|
||||
))
|
||||
};
|
||||
if res {
|
||||
Ok(ReadWriteMappedBuffer {
|
||||
buffer: buffer,
|
||||
buffer: self,
|
||||
map_info: map_info,
|
||||
})
|
||||
} else {
|
||||
Err(buffer)
|
||||
Err(self)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ impl BufferListRef {
|
|||
unsafe { ffi::gst_buffer_list_length(self.as_mut_ptr()) as usize }
|
||||
}
|
||||
|
||||
pub fn iter<'a>(&'a self) -> Iter<'a> {
|
||||
pub fn iter(&self) -> Iter {
|
||||
Iter::new(self)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ unsafe extern "C" fn trampoline_sync(
|
|||
func: gpointer,
|
||||
) -> ffi::GstBusSyncReply {
|
||||
let _guard = CallbackGuard::new();
|
||||
let f: &Box<Fn(&Bus, &Message) -> BusSyncReply + 'static> = transmute(func);
|
||||
let f: &&(Fn(&Bus, &Message) -> BusSyncReply + 'static) = transmute(func);
|
||||
f(&from_glib_none(bus), &Message::from_glib_none(msg)).to_glib()
|
||||
}
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ impl str::FromStr for Caps {
|
|||
|
||||
impl CapsRef {
|
||||
pub fn set_simple(&mut self, values: &[(&str, &ToValue)]) {
|
||||
for &(name, ref value) in values {
|
||||
for &(name, value) in values {
|
||||
let value = value.to_value();
|
||||
|
||||
unsafe {
|
||||
|
@ -135,7 +135,7 @@ impl CapsRef {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_mut_structure<'a>(&'a mut self, idx: u32) -> Option<&'a mut StructureRef> {
|
||||
pub fn get_mut_structure(&mut self, idx: u32) -> Option<&mut StructureRef> {
|
||||
unsafe {
|
||||
let structure = ffi::gst_caps_get_structure(self.as_ptr(), idx);
|
||||
if structure.is_null() {
|
||||
|
|
|
@ -31,7 +31,7 @@ impl Element {
|
|||
}
|
||||
}
|
||||
|
||||
return Ok(());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn unlink_many<E: IsA<Element>>(elements: &[&E]) {
|
||||
|
|
|
@ -342,7 +342,7 @@ impl<'a> StreamStart<'a> {
|
|||
if stream_id.is_null() {
|
||||
None
|
||||
} else {
|
||||
Some((CStr::from_ptr(stream_id).to_str().unwrap()))
|
||||
Some(CStr::from_ptr(stream_id).to_str().unwrap())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1070,7 +1070,7 @@ impl<'a> Redirect<'a> {
|
|||
|
||||
macro_rules! message_builder_generic_impl {
|
||||
($new_fn:expr) => {
|
||||
pub fn src<'b, T: IsA<Object> + Cast + Clone>(self, src: Option<&'b T>) -> Self {
|
||||
pub fn src<T: IsA<Object> + Cast + Clone>(self, src: Option<&T>) -> Self {
|
||||
Self {
|
||||
src: src.map(|o| {
|
||||
let o = (*o).clone();
|
||||
|
|
|
@ -254,7 +254,7 @@ unsafe extern "C" fn trampoline_pad_probe(
|
|||
func: gpointer,
|
||||
) -> ffi::GstPadProbeReturn {
|
||||
let _guard = CallbackGuard::new();
|
||||
let func: &Box<Fn(&Pad, &mut PadProbeInfo) -> PadProbeReturn + Send + Sync + 'static> =
|
||||
let func: &&(Fn(&Pad, &mut PadProbeInfo) -> PadProbeReturn + Send + Sync + 'static) =
|
||||
transmute(func);
|
||||
let mut data_type = None;
|
||||
|
||||
|
|
Loading…
Reference in a new issue