mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 02:51:10 +00:00
Update to Rust 1.31 linter-specific attributes
This commit is contained in:
parent
631eee13da
commit
8c39da4e5b
45 changed files with 108 additions and 120 deletions
|
@ -51,7 +51,11 @@ struct ErrorMessage {
|
|||
cause: glib::Error,
|
||||
}
|
||||
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#[derive(Debug, Fail)]
|
||||
#[fail(display = "Glutin error")]
|
||||
struct GlutinError();
|
||||
|
||||
#[rustfmt::skip]
|
||||
static VERTICES: [f32; 20] = [
|
||||
1.0, 1.0, 0.0, 1.0, 0.0,
|
||||
-1.0, 1.0, 0.0, 0.0, 0.0,
|
||||
|
@ -61,7 +65,7 @@ static VERTICES: [f32; 20] = [
|
|||
|
||||
static INDICES: [u16; 6] = [0, 1, 2, 0, 2, 3];
|
||||
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#[rustfmt::skip]
|
||||
static IDENTITY: [f32; 16] = [
|
||||
1.0, 0.0, 0.0, 0.0,
|
||||
0.0, 1.0, 0.0, 0.0,
|
||||
|
|
|
@ -128,7 +128,7 @@ fn create_ui(app: >k::Application) {
|
|||
// This is unsafe because the "window handle" we pass here is basically like a raw pointer.
|
||||
// If a wrong value were to be passed here (and you can pass any integer), then the window
|
||||
// system will most likely cause the application to crash.
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
// Here we ask gdk what native window handle we got assigned for
|
||||
// our video region from the window system, and then we will
|
||||
|
@ -152,7 +152,7 @@ fn create_ui(app: >k::Application) {
|
|||
// This is unsafe because the "window handle" we pass here is basically like a raw pointer.
|
||||
// If a wrong value were to be passed here (and you can pass any integer), then the window
|
||||
// system will most likely cause the application to crash.
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
// Here we ask gdk what native window handle we got assigned for
|
||||
// our video region from the windowing system, and then we will
|
||||
|
|
|
@ -20,7 +20,7 @@ use std::mem::transmute;
|
|||
use std::ptr;
|
||||
use AppSink;
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::type_complexity)]
|
||||
pub struct AppSinkCallbacks {
|
||||
eos: Option<RefCell<Box<FnMut(&AppSink) + Send + 'static>>>,
|
||||
new_preroll: Option<
|
||||
|
@ -46,7 +46,7 @@ impl AppSinkCallbacks {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::type_complexity)]
|
||||
pub struct AppSinkCallbacksBuilder {
|
||||
eos: Option<RefCell<Box<FnMut(&AppSink) + Send + 'static>>>,
|
||||
new_preroll: Option<
|
||||
|
|
|
@ -15,7 +15,7 @@ use std::mem;
|
|||
use std::ptr;
|
||||
use AppSrc;
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::type_complexity)]
|
||||
pub struct AppSrcCallbacks {
|
||||
need_data: Option<RefCell<Box<FnMut(&AppSrc, u32) + Send + 'static>>>,
|
||||
enough_data: Option<Box<Fn(&AppSrc) + Send + Sync + 'static>>,
|
||||
|
@ -38,7 +38,7 @@ impl AppSrcCallbacks {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::type_complexity)]
|
||||
pub struct AppSrcCallbacksBuilder {
|
||||
need_data: Option<RefCell<Box<FnMut(&AppSrc, u32) + Send + 'static>>>,
|
||||
enough_data: Option<Box<Fn(&AppSrc) + Send + Sync + 'static>>,
|
||||
|
|
|
@ -25,10 +25,9 @@ macro_rules! skip_assert_initialized {
|
|||
|
||||
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
|
||||
#[allow(clippy::unreadable_literal)]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[allow(clippy::match_same_arms)]
|
||||
#[rustfmt::skip]
|
||||
mod auto;
|
||||
pub use auto::*;
|
||||
|
|
|
@ -133,7 +133,7 @@ impl<'a> AudioInfoBuilder<'a> {
|
|||
}
|
||||
|
||||
impl AudioInfo {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(new_ret_no_self))]
|
||||
#[allow(clippy::new_ret_no_self)]
|
||||
pub fn new<'a>(format: ::AudioFormat, rate: u32, channels: u32) -> AudioInfoBuilder<'a> {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
|
|
|
@ -32,10 +32,9 @@ macro_rules! skip_assert_initialized {
|
|||
|
||||
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
|
||||
#[allow(clippy::unreadable_literal)]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[allow(clippy::match_same_arms)]
|
||||
#[rustfmt::skip]
|
||||
mod auto;
|
||||
pub use auto::*;
|
||||
|
|
|
@ -28,11 +28,10 @@ macro_rules! assert_initialized_main_thread {
|
|||
|
||||
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::unreadable_literal)]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[allow(clippy::match_same_arms)]
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[rustfmt::skip]
|
||||
mod auto;
|
||||
pub use auto::functions::*;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||
#![allow(clippy::cast_ptr_alignment)]
|
||||
|
||||
pub mod base_sink;
|
||||
pub mod base_src;
|
||||
|
|
|
@ -12,7 +12,7 @@ use glib_ffi;
|
|||
pub struct MutexGuard<'a>(&'a glib_ffi::GMutex);
|
||||
|
||||
impl<'a> MutexGuard<'a> {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(trivially_copy_pass_by_ref))]
|
||||
#[allow(clippy::trivially_copy_pass_by_ref)]
|
||||
pub fn lock(mutex: &'a glib_ffi::GMutex) -> Self {
|
||||
unsafe {
|
||||
glib_ffi::g_mutex_lock(mut_override(mutex));
|
||||
|
|
|
@ -25,11 +25,10 @@ macro_rules! assert_initialized_main_thread {
|
|||
|
||||
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::unreadable_literal)]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[allow(clippy::match_same_arms)]
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[rustfmt::skip]
|
||||
mod auto;
|
||||
pub use auto::*;
|
||||
|
|
|
@ -66,10 +66,9 @@ macro_rules! skip_assert_initialized {
|
|||
() => {};
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
|
||||
#[allow(clippy::unreadable_literal)]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[allow(clippy::match_same_arms)]
|
||||
#[rustfmt::skip]
|
||||
mod auto;
|
||||
pub use auto::*;
|
||||
|
|
|
@ -38,10 +38,9 @@ macro_rules! skip_assert_initialized {
|
|||
|
||||
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
|
||||
#[allow(clippy::unreadable_literal)]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[allow(clippy::match_same_arms)]
|
||||
#[rustfmt::skip]
|
||||
mod auto;
|
||||
pub use auto::*;
|
||||
|
|
|
@ -26,10 +26,9 @@ macro_rules! assert_initialized_main_thread {
|
|||
|
||||
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
|
||||
#[allow(clippy::unreadable_literal)]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[allow(clippy::match_same_arms)]
|
||||
#[rustfmt::skip]
|
||||
mod auto;
|
||||
pub use auto::*;
|
||||
|
|
|
@ -29,7 +29,7 @@ impl NetAddressMeta {
|
|||
}
|
||||
|
||||
pub fn set_addr<T: IsA<gio::SocketAddress>>(&mut self, addr: &T) {
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||
#![allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
gobject_ffi::g_object_unref(self.0.addr as *mut _);
|
||||
self.0.addr = addr.as_ref().to_glib_full();
|
||||
|
|
|
@ -39,11 +39,10 @@ macro_rules! skip_assert_initialized {
|
|||
|
||||
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::unreadable_literal)]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[allow(clippy::match_same_arms)]
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[rustfmt::skip]
|
||||
mod auto;
|
||||
pub use auto::functions::*;
|
||||
|
|
|
@ -28,13 +28,11 @@ macro_rules! assert_initialized_main_thread {
|
|||
|
||||
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(useless_transmute))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||
#[allow(clippy::unreadable_literal)]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[allow(clippy::match_same_arms)]
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
#[rustfmt::skip]
|
||||
mod auto;
|
||||
pub use auto::*;
|
||||
|
|
|
@ -56,7 +56,7 @@ impl Player {
|
|||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
|
@ -72,7 +72,7 @@ impl Player {
|
|||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
|
@ -88,7 +88,7 @@ impl Player {
|
|||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
connect_raw(
|
||||
|
|
|
@ -42,11 +42,10 @@ macro_rules! skip_assert_initialized {
|
|||
|
||||
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::unreadable_literal)]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[allow(clippy::match_same_arms)]
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[rustfmt::skip]
|
||||
mod auto;
|
||||
pub use auto::*;
|
||||
|
|
|
@ -26,7 +26,7 @@ unsafe extern "C" fn destroy_closure_watch<
|
|||
}
|
||||
|
||||
fn into_raw_watch<F: FnMut(&RTSPSessionPool) -> Continue + Send + 'static>(func: F) -> gpointer {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::type_complexity)]
|
||||
let func: Box<RefCell<F>> = Box::new(RefCell::new(func));
|
||||
Box::into_raw(func) as gpointer
|
||||
}
|
||||
|
|
|
@ -34,10 +34,9 @@ macro_rules! skip_assert_initialized {
|
|||
|
||||
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
|
||||
#[allow(clippy::unreadable_literal)]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[allow(clippy::match_same_arms)]
|
||||
#[rustfmt::skip]
|
||||
mod auto;
|
||||
pub use auto::*;
|
||||
|
|
|
@ -31,10 +31,9 @@ macro_rules! skip_assert_initialized {
|
|||
|
||||
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
|
||||
#[allow(clippy::unreadable_literal)]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[allow(clippy::match_same_arms)]
|
||||
#[allow(non_snake_case)]
|
||||
#[rustfmt::skip]
|
||||
mod auto;
|
||||
|
|
|
@ -41,7 +41,7 @@ impl SDPTime {
|
|||
}
|
||||
|
||||
pub fn repeat(&self) -> Vec<&str> {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
let arr = (*self.0.repeat).data as *const *const c_char;
|
||||
let len = (*self.0.repeat).len as usize;
|
||||
|
|
|
@ -35,10 +35,9 @@ macro_rules! skip_assert_initialized {
|
|||
|
||||
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
|
||||
#[allow(clippy::unreadable_literal)]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[allow(clippy::match_same_arms)]
|
||||
#[rustfmt::skip]
|
||||
mod auto;
|
||||
pub use auto::*;
|
||||
|
|
|
@ -442,7 +442,7 @@ impl<'a> VideoInfoBuilder<'a> {
|
|||
}
|
||||
|
||||
impl VideoInfo {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(new_ret_no_self))]
|
||||
#[allow(clippy::new_ret_no_self)]
|
||||
pub fn new<'a>(format: ::VideoFormat, width: u32, height: u32) -> VideoInfoBuilder<'a> {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ impl VideoOverlayCompositionMeta {
|
|||
}
|
||||
|
||||
pub fn set_overlay(&mut self, overlay: &::VideoOverlayComposition) {
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||
#![allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
gst_ffi::gst_mini_object_unref(self.0.overlay as *mut _);
|
||||
self.0.overlay = gst_ffi::gst_mini_object_ref(overlay.as_mut_ptr() as *mut _) as *mut _;
|
||||
|
|
|
@ -516,7 +516,7 @@ impl VideoTimeCodeMeta {
|
|||
}
|
||||
|
||||
pub fn set_tc(&mut self, tc: ValidVideoTimeCode) {
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||
#![allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
ffi::gst_video_time_code_clear(&mut self.0.tc);
|
||||
self.0.tc = tc.0;
|
||||
|
|
|
@ -31,10 +31,9 @@ macro_rules! skip_assert_initialized {
|
|||
|
||||
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
|
||||
#[allow(clippy::unreadable_literal)]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[allow(clippy::match_same_arms)]
|
||||
#[rustfmt::skip]
|
||||
mod auto;
|
||||
pub use auto::*;
|
||||
|
|
|
@ -36,7 +36,7 @@ unsafe extern "C" fn destroy_closure_watch<F: FnMut(&Bus, &Message) -> Continue
|
|||
}
|
||||
|
||||
fn into_raw_watch<F: FnMut(&Bus, &Message) -> Continue + 'static>(func: F) -> gpointer {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::type_complexity)]
|
||||
let func: Box<RefCell<F>> = Box::new(RefCell::new(func));
|
||||
Box::into_raw(func) as gpointer
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ unsafe extern "C" fn destroy_closure_wait_async<
|
|||
}
|
||||
|
||||
fn into_raw_wait_async<F: Fn(&Clock, ClockTime, &ClockId) + Send + 'static>(func: F) -> gpointer {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::type_complexity)]
|
||||
let func: Box<F> = Box::new(func);
|
||||
Box::into_raw(func) as gpointer
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ impl ClockTime {
|
|||
}
|
||||
|
||||
impl fmt::Display for ClockTime {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(many_single_char_names))]
|
||||
#[allow(clippy::many_single_char_names)]
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||
let precision = f.precision().unwrap_or(9);
|
||||
// TODO: Could also check width and pad the hours as needed
|
||||
|
|
|
@ -123,7 +123,7 @@ pub trait ElementExtManual: 'static {
|
|||
fn get_pad_template(&self, name: &str) -> Option<PadTemplate>;
|
||||
fn get_pad_template_list(&self) -> Vec<PadTemplate>;
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn message_full<T: ::MessageErrorDomain>(
|
||||
&self,
|
||||
type_: ElementMessageType,
|
||||
|
@ -136,7 +136,7 @@ pub trait ElementExtManual: 'static {
|
|||
);
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn message_full_with_details<T: ::MessageErrorDomain>(
|
||||
&self,
|
||||
type_: ElementMessageType,
|
||||
|
|
|
@ -916,7 +916,7 @@ impl<'a> EventBuilder<'a> {
|
|||
|
||||
macro_rules! event_builder_generic_impl {
|
||||
($new_fn:expr) => {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(needless_update))]
|
||||
#[allow(clippy::needless_update)]
|
||||
pub fn seqnum(self, seqnum: Seqnum) -> Self {
|
||||
Self {
|
||||
builder: self.builder.seqnum(seqnum),
|
||||
|
@ -924,7 +924,7 @@ macro_rules! event_builder_generic_impl {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(needless_update))]
|
||||
#[allow(clippy::needless_update)]
|
||||
pub fn running_time_offset(self, running_time_offset: i64) -> Self {
|
||||
Self {
|
||||
builder: self.builder.running_time_offset(running_time_offset),
|
||||
|
@ -932,7 +932,7 @@ macro_rules! event_builder_generic_impl {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(needless_update))]
|
||||
#[allow(clippy::needless_update)]
|
||||
pub fn other_fields(self, other_fields: &[(&'a str, &'a ToSendValue)]) -> Self {
|
||||
Self {
|
||||
builder: self.builder.other_fields(other_fields),
|
||||
|
|
|
@ -333,7 +333,7 @@ where
|
|||
|
||||
let func = func as *const gobject_ffi::GValue;
|
||||
let func = gobject_ffi::g_value_get_boxed(func);
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[allow(clippy::transmute_ptr_to_ref)]
|
||||
let func: &&(Fn(T) -> bool + Send + Sync + 'static) = mem::transmute(func);
|
||||
|
||||
let value = &*(value as *const glib::Value);
|
||||
|
|
|
@ -59,11 +59,10 @@ macro_rules! skip_assert_initialized {
|
|||
|
||||
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::unreadable_literal)]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[allow(clippy::match_same_arms)]
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[rustfmt::skip]
|
||||
mod auto;
|
||||
pub use auto::functions::*;
|
||||
|
|
|
@ -20,7 +20,7 @@ use glib::IsA;
|
|||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
pub struct DebugCategory(ptr::NonNull<ffi::GstDebugCategory>);
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(trivially_copy_pass_by_ref))]
|
||||
#[allow(clippy::trivially_copy_pass_by_ref)]
|
||||
impl DebugCategory {
|
||||
pub fn new<'a, P: Into<Option<&'a str>>>(
|
||||
name: &str,
|
||||
|
|
|
@ -1187,7 +1187,7 @@ impl<'a> MessageBuilder<'a> {
|
|||
|
||||
macro_rules! message_builder_generic_impl {
|
||||
($new_fn:expr) => {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(needless_update))]
|
||||
#[allow(clippy::needless_update)]
|
||||
pub fn src<O: IsA<Object> + Cast + Clone>(self, src: Option<&O>) -> Self {
|
||||
Self {
|
||||
builder: self.builder.src(src),
|
||||
|
@ -1195,7 +1195,7 @@ macro_rules! message_builder_generic_impl {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(needless_update))]
|
||||
#[allow(clippy::needless_update)]
|
||||
pub fn seqnum(self, seqnum: Seqnum) -> Self {
|
||||
Self {
|
||||
builder: self.builder.seqnum(seqnum),
|
||||
|
@ -1204,7 +1204,7 @@ macro_rules! message_builder_generic_impl {
|
|||
}
|
||||
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(needless_update))]
|
||||
#[allow(clippy::needless_update)]
|
||||
pub fn other_fields(self, other_fields: &[(&'a str, &'a ToSendValue)]) -> Self {
|
||||
Self {
|
||||
builder: self.builder.other_fields(other_fields),
|
||||
|
@ -2268,7 +2268,7 @@ pub struct RedirectBuilder<'a> {
|
|||
location: &'a str,
|
||||
tag_list: Option<&'a TagList>,
|
||||
entry_struct: Option<Structure>,
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::type_complexity)]
|
||||
entries: Option<&'a [(&'a str, Option<&'a TagList>, Option<&'a Structure>)]>,
|
||||
}
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
|
|
|
@ -245,7 +245,7 @@ impl<'a, T: MiniObject + 'static> ToGlibPtrMut<'a, *mut T::GstType> for GstRc<T>
|
|||
}
|
||||
|
||||
impl<'a, T: MiniObject + 'static> ToGlibContainerFromSlice<'a, *mut *mut T::GstType> for GstRc<T> {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::type_complexity)]
|
||||
type Storage = (
|
||||
Vec<Stash<'a, *mut T::GstType, GstRc<T>>>,
|
||||
Option<Vec<*mut T::GstType>>,
|
||||
|
@ -296,7 +296,7 @@ impl<'a, T: MiniObject + 'static> ToGlibContainerFromSlice<'a, *mut *mut T::GstT
|
|||
impl<'a, T: MiniObject + 'static> ToGlibContainerFromSlice<'a, *const *mut T::GstType>
|
||||
for GstRc<T>
|
||||
{
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::type_complexity)]
|
||||
type Storage = (
|
||||
Vec<Stash<'a, *mut T::GstType, GstRc<T>>>,
|
||||
Option<Vec<*mut T::GstType>>,
|
||||
|
@ -607,7 +607,7 @@ macro_rules! gst_define_mini_object_wrapper(
|
|||
}
|
||||
|
||||
impl<'a> $crate::glib::translate::ToGlibContainerFromSlice<'a, *mut *mut $ffi_name> for $name {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::type_complexity)]
|
||||
type Storage = (
|
||||
Vec<$crate::glib::translate::Stash<'a, *mut $ffi_name, $name>>,
|
||||
Option<Vec<*mut $ffi_name>>,
|
||||
|
@ -658,7 +658,7 @@ macro_rules! gst_define_mini_object_wrapper(
|
|||
impl<'a> $crate::glib::translate::ToGlibContainerFromSlice<'a, *const *mut $ffi_name>
|
||||
for $name
|
||||
{
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::type_complexity)]
|
||||
type Storage = (
|
||||
Vec<$crate::glib::translate::Stash<'a, *mut $ffi_name, $name>>,
|
||||
Option<Vec<*mut $ffi_name>>,
|
||||
|
@ -844,7 +844,7 @@ macro_rules! gst_define_mini_object_wrapper(
|
|||
type Owned = $name;
|
||||
|
||||
fn to_owned(&self) -> $name {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
$name($crate::glib::translate::from_glib_none($crate::miniobject::MiniObject::as_ptr(self)))
|
||||
}
|
||||
|
|
|
@ -516,7 +516,7 @@ impl<O: IsA<Pad>> PadExtManual for O {
|
|||
where
|
||||
F: Fn(&Self, &Option<::Object>) -> Result<(), LoggableError> + Send + Sync + 'static,
|
||||
{
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::type_complexity)]
|
||||
unsafe {
|
||||
let func_box: Box<F> = Box::new(func);
|
||||
ffi::gst_pad_set_activate_function_full(
|
||||
|
@ -535,7 +535,7 @@ impl<O: IsA<Pad>> PadExtManual for O {
|
|||
+ Sync
|
||||
+ 'static,
|
||||
{
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::type_complexity)]
|
||||
unsafe {
|
||||
let func_box: Box<F> = Box::new(func);
|
||||
ffi::gst_pad_set_activatemode_function_full(
|
||||
|
@ -1346,7 +1346,7 @@ unsafe extern "C" fn trampoline_pad_task<F: FnMut() + Send + 'static>(func: gpoi
|
|||
}
|
||||
|
||||
fn into_raw_pad_task<F: FnMut() + Send + 'static>(func: F) -> gpointer {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||
#[allow(clippy::type_complexity)]
|
||||
let func: Box<RefCell<F>> = Box::new(RefCell::new(func));
|
||||
Box::into_raw(func) as gpointer
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ impl<T: FormattedValue> FormattedSegment<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn do_seek<V: Into<T>>(
|
||||
&mut self,
|
||||
rate: f64,
|
||||
|
@ -367,7 +367,7 @@ impl<T: FormattedValue> FormattedSegment<T> {
|
|||
self.0.rate
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(float_cmp))]
|
||||
#[allow(clippy::float_cmp)]
|
||||
pub fn set_rate(&mut self, rate: f64) {
|
||||
assert_ne!(rate, 0.0);
|
||||
self.0.rate = rate;
|
||||
|
@ -377,7 +377,7 @@ impl<T: FormattedValue> FormattedSegment<T> {
|
|||
self.0.applied_rate
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(float_cmp))]
|
||||
#[allow(clippy::float_cmp)]
|
||||
pub fn set_applied_rate(&mut self, applied_rate: f64) {
|
||||
assert_ne!(applied_rate, 0.0);
|
||||
self.0.applied_rate = applied_rate;
|
||||
|
|
|
@ -20,7 +20,7 @@ macro_rules! gst_panic_to_error(
|
|||
use std::sync::atomic::Ordering;
|
||||
use $crate::ElementExtManual;
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(unused_unit))]
|
||||
#[allow(clippy::unused_unit)]
|
||||
{
|
||||
if $panicked.load(Ordering::Relaxed) {
|
||||
$element.post_error_message(&gst_error_msg!($crate::LibraryError::Failed, ["Panicked"]));
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||
#![allow(clippy::cast_ptr_alignment)]
|
||||
|
||||
#[macro_use]
|
||||
pub mod error;
|
||||
|
|
|
@ -12,7 +12,7 @@ use glib_ffi;
|
|||
pub struct MutexGuard<'a>(&'a glib_ffi::GMutex);
|
||||
|
||||
impl<'a> MutexGuard<'a> {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(trivially_copy_pass_by_ref))]
|
||||
#[allow(clippy::trivially_copy_pass_by_ref)]
|
||||
pub fn lock(mutex: &'a glib_ffi::GMutex) -> Self {
|
||||
unsafe {
|
||||
glib_ffi::g_mutex_lock(mut_override(mutex));
|
||||
|
|
|
@ -565,7 +565,7 @@ impl<'a> FromValue<'a> for Array<'a> {
|
|||
if arr.is_null() {
|
||||
Array(Cow::Borrowed(&[]))
|
||||
} else {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
Array(Cow::Borrowed(slice::from_raw_parts(
|
||||
(*arr).data as *const glib::SendValue,
|
||||
(*arr).len as usize,
|
||||
|
@ -643,7 +643,7 @@ impl<'a> FromValue<'a> for List<'a> {
|
|||
if arr.is_null() {
|
||||
List(Cow::Borrowed(&[]))
|
||||
} else {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
List(Cow::Borrowed(slice::from_raw_parts(
|
||||
(*arr).data as *const glib::SendValue,
|
||||
(*arr).len as usize,
|
||||
|
|
|
@ -221,7 +221,7 @@ mod tutorial5 {
|
|||
) -> *mut c_void;
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
let xid = gdk_x11_window_get_xid(gdk_window.as_ptr() as *mut _);
|
||||
video_overlay.set_window_handle(xid as usize);
|
||||
|
@ -238,7 +238,7 @@ mod tutorial5 {
|
|||
) -> *mut c_void;
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
unsafe {
|
||||
let window = gdk_quartz_window_get_nsview(gdk_window.as_ptr() as *mut _);
|
||||
video_overlay.set_window_handle(window as usize);
|
||||
|
|
Loading…
Reference in a new issue