forked from mirrors/gstreamer-rs
fix option_as_ref_deref clippy warnings
This commit is contained in:
parent
20b672eae3
commit
872024c372
2 changed files with 2 additions and 11 deletions
|
@ -771,8 +771,6 @@ where
|
||||||
T: BaseSrcImpl,
|
T: BaseSrcImpl,
|
||||||
T::Instance: PanicPoison,
|
T::Instance: PanicPoison,
|
||||||
{
|
{
|
||||||
use std::ops::DerefMut;
|
|
||||||
|
|
||||||
let instance = &*(ptr as *mut T::Instance);
|
let instance = &*(ptr as *mut T::Instance);
|
||||||
let imp = instance.get_impl();
|
let imp = instance.get_impl();
|
||||||
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
|
let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr);
|
||||||
|
@ -787,12 +785,7 @@ where
|
||||||
};
|
};
|
||||||
|
|
||||||
gst_panic_to_error!(&wrap, &instance.panicked(), gst::FlowReturn::Error, {
|
gst_panic_to_error!(&wrap, &instance.panicked(), gst::FlowReturn::Error, {
|
||||||
match imp.create(
|
match imp.create(&wrap, offset, buffer.as_deref_mut(), length) {
|
||||||
&wrap,
|
|
||||||
offset,
|
|
||||||
buffer.as_mut().map(|b| b.deref_mut()),
|
|
||||||
length,
|
|
||||||
) {
|
|
||||||
Ok(CreateSuccess::NewBuffer(new_buffer)) => {
|
Ok(CreateSuccess::NewBuffer(new_buffer)) => {
|
||||||
if let Some(passed_buffer) = buffer {
|
if let Some(passed_buffer) = buffer {
|
||||||
if passed_buffer.as_ptr() != new_buffer.as_ptr() {
|
if passed_buffer.as_ptr() != new_buffer.as_ptr() {
|
||||||
|
|
|
@ -1397,8 +1397,6 @@ unsafe extern "C" fn trampoline_getrange_function<
|
||||||
where
|
where
|
||||||
T: IsA<Pad>,
|
T: IsA<Pad>,
|
||||||
{
|
{
|
||||||
use std::ops::DerefMut;
|
|
||||||
|
|
||||||
let func: &F = &*((*pad).getrangedata as *const F);
|
let func: &F = &*((*pad).getrangedata as *const F);
|
||||||
|
|
||||||
assert!(!buffer.is_null());
|
assert!(!buffer.is_null());
|
||||||
|
@ -1417,7 +1415,7 @@ where
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.as_ref(),
|
.as_ref(),
|
||||||
offset,
|
offset,
|
||||||
passed_buffer.as_mut().map(|b| b.deref_mut()),
|
passed_buffer.as_deref_mut(),
|
||||||
length,
|
length,
|
||||||
) {
|
) {
|
||||||
Ok(PadGetRangeSuccess::NewBuffer(new_buffer)) => {
|
Ok(PadGetRangeSuccess::NewBuffer(new_buffer)) => {
|
||||||
|
|
Loading…
Reference in a new issue