gstreamer: Remove unused leftover ToGlib import

And directly call from_glib_borrow() instead of adding a use statement
for it.
This commit is contained in:
Sebastian Dröge 2021-04-28 09:28:54 +03:00
parent ffe6821813
commit 3ad7a18792
2 changed files with 2 additions and 6 deletions

View file

@ -15,8 +15,6 @@ macro_rules! plugin_define(
$version:expr, $license:expr, $source:expr, $version:expr, $license:expr, $source:expr,
$package:expr, $origin:expr, $release_datetime:expr) => { $package:expr, $origin:expr, $release_datetime:expr) => {
pub mod plugin_desc { pub mod plugin_desc {
use $crate::glib::translate::{from_glib_borrow, ToGlib, from_glib};
#[repr(transparent)] #[repr(transparent)]
pub struct GstPluginDesc($crate::ffi::GstPluginDesc); pub struct GstPluginDesc($crate::ffi::GstPluginDesc);
unsafe impl Send for GstPluginDesc {} unsafe impl Send for GstPluginDesc {}
@ -63,7 +61,7 @@ macro_rules! plugin_define(
unsafe extern "C" fn plugin_init_trampoline(plugin: *mut $crate::ffi::GstPlugin) -> $crate::glib::ffi::gboolean { unsafe extern "C" fn plugin_init_trampoline(plugin: *mut $crate::ffi::GstPlugin) -> $crate::glib::ffi::gboolean {
use std::panic::{self, AssertUnwindSafe}; use std::panic::{self, AssertUnwindSafe};
let panic_result = panic::catch_unwind(AssertUnwindSafe(|| super::$plugin_init(&from_glib_borrow(plugin)))); let panic_result = panic::catch_unwind(AssertUnwindSafe(|| super::$plugin_init(&$crate::glib::translate::from_glib_borrow(plugin))));
match panic_result { match panic_result {
Ok(register_result) => match register_result { Ok(register_result) => match register_result {
Ok(_) => $crate::glib::ffi::GTRUE, Ok(_) => $crate::glib::ffi::GTRUE,

View file

@ -20,8 +20,6 @@ macro_rules! plugin_define(
$version:expr, $license:expr, $source:expr, $version:expr, $license:expr, $source:expr,
$package:expr, $origin:expr, $release_datetime:expr) => { $package:expr, $origin:expr, $release_datetime:expr) => {
pub mod plugin_desc { pub mod plugin_desc {
use $crate::glib::translate::{from_glib_borrow, IntoGlib, from_glib};
#[repr(transparent)] #[repr(transparent)]
pub struct GstPluginDesc($crate::ffi::GstPluginDesc); pub struct GstPluginDesc($crate::ffi::GstPluginDesc);
unsafe impl Send for GstPluginDesc {} unsafe impl Send for GstPluginDesc {}
@ -80,7 +78,7 @@ macro_rules! plugin_define(
unsafe extern "C" fn plugin_init_trampoline(plugin: *mut $crate::ffi::GstPlugin) -> $crate::glib::ffi::gboolean { unsafe extern "C" fn plugin_init_trampoline(plugin: *mut $crate::ffi::GstPlugin) -> $crate::glib::ffi::gboolean {
use std::panic::{self, AssertUnwindSafe}; use std::panic::{self, AssertUnwindSafe};
let panic_result = panic::catch_unwind(AssertUnwindSafe(|| super::$plugin_init(&from_glib_borrow(plugin)))); let panic_result = panic::catch_unwind(AssertUnwindSafe(|| super::$plugin_init(&$crate::glib::translate::from_glib_borrow(plugin))));
match panic_result { match panic_result {
Ok(register_result) => match register_result { Ok(register_result) => match register_result {
Ok(_) => $crate::glib::ffi::GTRUE, Ok(_) => $crate::glib::ffi::GTRUE,