Update to Rust 1.31 linter-specific attributes

This commit is contained in:
Sebastian Dröge 2019-02-28 10:32:13 +02:00
parent 631eee13da
commit 8c39da4e5b
45 changed files with 108 additions and 120 deletions

View file

@ -51,7 +51,11 @@ struct ErrorMessage {
cause: glib::Error, cause: glib::Error,
} }
#[cfg_attr(rustfmt, rustfmt_skip)] #[derive(Debug, Fail)]
#[fail(display = "Glutin error")]
struct GlutinError();
#[rustfmt::skip]
static VERTICES: [f32; 20] = [ static VERTICES: [f32; 20] = [
1.0, 1.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, 0.0,
-1.0, 1.0, 0.0, 0.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]; static INDICES: [u16; 6] = [0, 1, 2, 0, 2, 3];
#[cfg_attr(rustfmt, rustfmt_skip)] #[rustfmt::skip]
static IDENTITY: [f32; 16] = [ static IDENTITY: [f32; 16] = [
1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0,

View file

@ -128,7 +128,7 @@ fn create_ui(app: &gtk::Application) {
// This is unsafe because the "window handle" we pass here is basically like a raw pointer. // 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 // 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. // system will most likely cause the application to crash.
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] #[allow(clippy::cast_ptr_alignment)]
unsafe { unsafe {
// Here we ask gdk what native window handle we got assigned for // Here we ask gdk what native window handle we got assigned for
// our video region from the window system, and then we will // our video region from the window system, and then we will
@ -152,7 +152,7 @@ fn create_ui(app: &gtk::Application) {
// This is unsafe because the "window handle" we pass here is basically like a raw pointer. // 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 // 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. // system will most likely cause the application to crash.
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] #[allow(clippy::cast_ptr_alignment)]
unsafe { unsafe {
// Here we ask gdk what native window handle we got assigned for // Here we ask gdk what native window handle we got assigned for
// our video region from the windowing system, and then we will // our video region from the windowing system, and then we will

View file

@ -20,7 +20,7 @@ use std::mem::transmute;
use std::ptr; use std::ptr;
use AppSink; use AppSink;
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] #[allow(clippy::type_complexity)]
pub struct AppSinkCallbacks { pub struct AppSinkCallbacks {
eos: Option<RefCell<Box<FnMut(&AppSink) + Send + 'static>>>, eos: Option<RefCell<Box<FnMut(&AppSink) + Send + 'static>>>,
new_preroll: Option< new_preroll: Option<
@ -46,7 +46,7 @@ impl AppSinkCallbacks {
} }
} }
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] #[allow(clippy::type_complexity)]
pub struct AppSinkCallbacksBuilder { pub struct AppSinkCallbacksBuilder {
eos: Option<RefCell<Box<FnMut(&AppSink) + Send + 'static>>>, eos: Option<RefCell<Box<FnMut(&AppSink) + Send + 'static>>>,
new_preroll: Option< new_preroll: Option<

View file

@ -15,7 +15,7 @@ use std::mem;
use std::ptr; use std::ptr;
use AppSrc; use AppSrc;
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] #[allow(clippy::type_complexity)]
pub struct AppSrcCallbacks { pub struct AppSrcCallbacks {
need_data: Option<RefCell<Box<FnMut(&AppSrc, u32) + Send + 'static>>>, need_data: Option<RefCell<Box<FnMut(&AppSrc, u32) + Send + 'static>>>,
enough_data: Option<Box<Fn(&AppSrc) + Send + Sync + '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 { pub struct AppSrcCallbacksBuilder {
need_data: Option<RefCell<Box<FnMut(&AppSrc, u32) + Send + 'static>>>, need_data: Option<RefCell<Box<FnMut(&AppSrc, u32) + Send + 'static>>>,
enough_data: Option<Box<Fn(&AppSrc) + Send + Sync + 'static>>, enough_data: Option<Box<Fn(&AppSrc) + Send + Sync + 'static>>,

View file

@ -25,10 +25,9 @@ macro_rules! skip_assert_initialized {
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] #[allow(clippy::unreadable_literal)]
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] #[allow(clippy::too_many_arguments)]
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] #[allow(clippy::match_same_arms)]
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
#[rustfmt::skip] #[rustfmt::skip]
mod auto; mod auto;
pub use auto::*; pub use auto::*;

View file

@ -133,7 +133,7 @@ impl<'a> AudioInfoBuilder<'a> {
} }
impl AudioInfo { 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> { pub fn new<'a>(format: ::AudioFormat, rate: u32, channels: u32) -> AudioInfoBuilder<'a> {
assert_initialized_main_thread!(); assert_initialized_main_thread!();

View file

@ -32,10 +32,9 @@ macro_rules! skip_assert_initialized {
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] #[allow(clippy::unreadable_literal)]
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] #[allow(clippy::too_many_arguments)]
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] #[allow(clippy::match_same_arms)]
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
#[rustfmt::skip] #[rustfmt::skip]
mod auto; mod auto;
pub use auto::*; pub use auto::*;

View file

@ -28,11 +28,10 @@ macro_rules! assert_initialized_main_thread {
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] #[allow(clippy::unreadable_literal)]
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] #[allow(clippy::too_many_arguments)]
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] #[allow(clippy::match_same_arms)]
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] #[allow(clippy::type_complexity)]
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
#[rustfmt::skip] #[rustfmt::skip]
mod auto; mod auto;
pub use auto::functions::*; pub use auto::functions::*;

View file

@ -6,7 +6,7 @@
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // 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_sink;
pub mod base_src; pub mod base_src;

View file

@ -12,7 +12,7 @@ use glib_ffi;
pub struct MutexGuard<'a>(&'a glib_ffi::GMutex); pub struct MutexGuard<'a>(&'a glib_ffi::GMutex);
impl<'a> MutexGuard<'a> { 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 { pub fn lock(mutex: &'a glib_ffi::GMutex) -> Self {
unsafe { unsafe {
glib_ffi::g_mutex_lock(mut_override(mutex)); glib_ffi::g_mutex_lock(mut_override(mutex));

View file

@ -25,11 +25,10 @@ macro_rules! assert_initialized_main_thread {
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] #[allow(clippy::unreadable_literal)]
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] #[allow(clippy::too_many_arguments)]
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] #[allow(clippy::match_same_arms)]
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] #[allow(clippy::type_complexity)]
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
#[rustfmt::skip] #[rustfmt::skip]
mod auto; mod auto;
pub use auto::*; pub use auto::*;

View file

@ -66,10 +66,9 @@ macro_rules! skip_assert_initialized {
() => {}; () => {};
} }
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] #[allow(clippy::unreadable_literal)]
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] #[allow(clippy::too_many_arguments)]
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] #[allow(clippy::match_same_arms)]
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
#[rustfmt::skip] #[rustfmt::skip]
mod auto; mod auto;
pub use auto::*; pub use auto::*;

View file

@ -38,10 +38,9 @@ macro_rules! skip_assert_initialized {
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] #[allow(clippy::unreadable_literal)]
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] #[allow(clippy::too_many_arguments)]
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] #[allow(clippy::match_same_arms)]
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
#[rustfmt::skip] #[rustfmt::skip]
mod auto; mod auto;
pub use auto::*; pub use auto::*;

View file

@ -26,10 +26,9 @@ macro_rules! assert_initialized_main_thread {
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] #[allow(clippy::unreadable_literal)]
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] #[allow(clippy::too_many_arguments)]
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] #[allow(clippy::match_same_arms)]
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
#[rustfmt::skip] #[rustfmt::skip]
mod auto; mod auto;
pub use auto::*; pub use auto::*;

View file

@ -29,7 +29,7 @@ impl NetAddressMeta {
} }
pub fn set_addr<T: IsA<gio::SocketAddress>>(&mut self, addr: &T) { 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 { unsafe {
gobject_ffi::g_object_unref(self.0.addr as *mut _); gobject_ffi::g_object_unref(self.0.addr as *mut _);
self.0.addr = addr.as_ref().to_glib_full(); self.0.addr = addr.as_ref().to_glib_full();

View file

@ -39,11 +39,10 @@ macro_rules! skip_assert_initialized {
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] #[allow(clippy::unreadable_literal)]
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] #[allow(clippy::too_many_arguments)]
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] #[allow(clippy::match_same_arms)]
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] #[allow(clippy::type_complexity)]
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
#[rustfmt::skip] #[rustfmt::skip]
mod auto; mod auto;
pub use auto::functions::*; pub use auto::functions::*;

View file

@ -28,13 +28,11 @@ macro_rules! assert_initialized_main_thread {
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] #[allow(clippy::unreadable_literal)]
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] #[allow(clippy::too_many_arguments)]
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] #[allow(clippy::match_same_arms)]
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] #[allow(clippy::type_complexity)]
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] #[allow(clippy::cast_ptr_alignment)]
#[cfg_attr(feature = "cargo-clippy", allow(useless_transmute))]
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
#[rustfmt::skip] #[rustfmt::skip]
mod auto; mod auto;
pub use auto::*; pub use auto::*;

View file

@ -56,7 +56,7 @@ impl Player {
&self, &self,
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] #[allow(clippy::cast_ptr_alignment)]
unsafe { unsafe {
let f: Box_<F> = Box_::new(f); let f: Box_<F> = Box_::new(f);
connect_raw( connect_raw(
@ -72,7 +72,7 @@ impl Player {
&self, &self,
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] #[allow(clippy::cast_ptr_alignment)]
unsafe { unsafe {
let f: Box_<F> = Box_::new(f); let f: Box_<F> = Box_::new(f);
connect_raw( connect_raw(
@ -88,7 +88,7 @@ impl Player {
&self, &self,
f: F, f: F,
) -> SignalHandlerId { ) -> SignalHandlerId {
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] #[allow(clippy::cast_ptr_alignment)]
unsafe { unsafe {
let f: Box_<F> = Box_::new(f); let f: Box_<F> = Box_::new(f);
connect_raw( connect_raw(

View file

@ -42,11 +42,10 @@ macro_rules! skip_assert_initialized {
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] #[allow(clippy::unreadable_literal)]
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] #[allow(clippy::too_many_arguments)]
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] #[allow(clippy::match_same_arms)]
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] #[allow(clippy::type_complexity)]
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
#[rustfmt::skip] #[rustfmt::skip]
mod auto; mod auto;
pub use auto::*; pub use auto::*;

View file

@ -26,7 +26,7 @@ unsafe extern "C" fn destroy_closure_watch<
} }
fn into_raw_watch<F: FnMut(&RTSPSessionPool) -> Continue + Send + 'static>(func: F) -> gpointer { 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)); let func: Box<RefCell<F>> = Box::new(RefCell::new(func));
Box::into_raw(func) as gpointer Box::into_raw(func) as gpointer
} }

View file

@ -34,10 +34,9 @@ macro_rules! skip_assert_initialized {
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] #[allow(clippy::unreadable_literal)]
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] #[allow(clippy::too_many_arguments)]
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] #[allow(clippy::match_same_arms)]
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
#[rustfmt::skip] #[rustfmt::skip]
mod auto; mod auto;
pub use auto::*; pub use auto::*;

View file

@ -31,10 +31,9 @@ macro_rules! skip_assert_initialized {
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] #[allow(clippy::unreadable_literal)]
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] #[allow(clippy::too_many_arguments)]
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] #[allow(clippy::match_same_arms)]
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
#[allow(non_snake_case)] #[allow(non_snake_case)]
#[rustfmt::skip] #[rustfmt::skip]
mod auto; mod auto;

View file

@ -41,7 +41,7 @@ impl SDPTime {
} }
pub fn repeat(&self) -> Vec<&str> { pub fn repeat(&self) -> Vec<&str> {
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] #[allow(clippy::cast_ptr_alignment)]
unsafe { unsafe {
let arr = (*self.0.repeat).data as *const *const c_char; let arr = (*self.0.repeat).data as *const *const c_char;
let len = (*self.0.repeat).len as usize; let len = (*self.0.repeat).len as usize;

View file

@ -35,10 +35,9 @@ macro_rules! skip_assert_initialized {
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] #[allow(clippy::unreadable_literal)]
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] #[allow(clippy::too_many_arguments)]
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] #[allow(clippy::match_same_arms)]
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
#[rustfmt::skip] #[rustfmt::skip]
mod auto; mod auto;
pub use auto::*; pub use auto::*;

View file

@ -442,7 +442,7 @@ impl<'a> VideoInfoBuilder<'a> {
} }
impl VideoInfo { 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> { pub fn new<'a>(format: ::VideoFormat, width: u32, height: u32) -> VideoInfoBuilder<'a> {
assert_initialized_main_thread!(); assert_initialized_main_thread!();

View file

@ -154,7 +154,7 @@ impl VideoOverlayCompositionMeta {
} }
pub fn set_overlay(&mut self, overlay: &::VideoOverlayComposition) { pub fn set_overlay(&mut self, overlay: &::VideoOverlayComposition) {
#![cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] #![allow(clippy::cast_ptr_alignment)]
unsafe { unsafe {
gst_ffi::gst_mini_object_unref(self.0.overlay as *mut _); 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 _; self.0.overlay = gst_ffi::gst_mini_object_ref(overlay.as_mut_ptr() as *mut _) as *mut _;

View file

@ -516,7 +516,7 @@ impl VideoTimeCodeMeta {
} }
pub fn set_tc(&mut self, tc: ValidVideoTimeCode) { pub fn set_tc(&mut self, tc: ValidVideoTimeCode) {
#![cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] #![allow(clippy::cast_ptr_alignment)]
unsafe { unsafe {
ffi::gst_video_time_code_clear(&mut self.0.tc); ffi::gst_video_time_code_clear(&mut self.0.tc);
self.0.tc = tc.0; self.0.tc = tc.0;

View file

@ -31,10 +31,9 @@ macro_rules! skip_assert_initialized {
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] #[allow(clippy::unreadable_literal)]
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] #[allow(clippy::too_many_arguments)]
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] #[allow(clippy::match_same_arms)]
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))]
#[rustfmt::skip] #[rustfmt::skip]
mod auto; mod auto;
pub use auto::*; pub use auto::*;

View file

@ -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 { 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)); let func: Box<RefCell<F>> = Box::new(RefCell::new(func));
Box::into_raw(func) as gpointer Box::into_raw(func) as gpointer
} }

View file

@ -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 { 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); let func: Box<F> = Box::new(func);
Box::into_raw(func) as gpointer Box::into_raw(func) as gpointer
} }

View file

@ -65,7 +65,7 @@ impl ClockTime {
} }
impl fmt::Display for 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> { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
let precision = f.precision().unwrap_or(9); let precision = f.precision().unwrap_or(9);
// TODO: Could also check width and pad the hours as needed // TODO: Could also check width and pad the hours as needed

View file

@ -123,7 +123,7 @@ pub trait ElementExtManual: 'static {
fn get_pad_template(&self, name: &str) -> Option<PadTemplate>; fn get_pad_template(&self, name: &str) -> Option<PadTemplate>;
fn get_pad_template_list(&self) -> Vec<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>( fn message_full<T: ::MessageErrorDomain>(
&self, &self,
type_: ElementMessageType, type_: ElementMessageType,
@ -136,7 +136,7 @@ pub trait ElementExtManual: 'static {
); );
#[cfg(any(feature = "v1_10", feature = "dox"))] #[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>( fn message_full_with_details<T: ::MessageErrorDomain>(
&self, &self,
type_: ElementMessageType, type_: ElementMessageType,

View file

@ -916,7 +916,7 @@ impl<'a> EventBuilder<'a> {
macro_rules! event_builder_generic_impl { macro_rules! event_builder_generic_impl {
($new_fn:expr) => { ($new_fn:expr) => {
#[cfg_attr(feature = "cargo-clippy", allow(needless_update))] #[allow(clippy::needless_update)]
pub fn seqnum(self, seqnum: Seqnum) -> Self { pub fn seqnum(self, seqnum: Seqnum) -> Self {
Self { Self {
builder: self.builder.seqnum(seqnum), 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 { pub fn running_time_offset(self, running_time_offset: i64) -> Self {
Self { Self {
builder: self.builder.running_time_offset(running_time_offset), 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 { pub fn other_fields(self, other_fields: &[(&'a str, &'a ToSendValue)]) -> Self {
Self { Self {
builder: self.builder.other_fields(other_fields), builder: self.builder.other_fields(other_fields),

View file

@ -333,7 +333,7 @@ where
let func = func as *const gobject_ffi::GValue; let func = func as *const gobject_ffi::GValue;
let func = gobject_ffi::g_value_get_boxed(func); 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 func: &&(Fn(T) -> bool + Send + Sync + 'static) = mem::transmute(func);
let value = &*(value as *const glib::Value); let value = &*(value as *const glib::Value);

View file

@ -59,11 +59,10 @@ macro_rules! skip_assert_initialized {
pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value}; pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value};
#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] #[allow(clippy::unreadable_literal)]
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] #[allow(clippy::too_many_arguments)]
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] #[allow(clippy::match_same_arms)]
#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] #[allow(clippy::type_complexity)]
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
#[rustfmt::skip] #[rustfmt::skip]
mod auto; mod auto;
pub use auto::functions::*; pub use auto::functions::*;

View file

@ -20,7 +20,7 @@ use glib::IsA;
#[derive(PartialEq, Eq, Clone, Copy)] #[derive(PartialEq, Eq, Clone, Copy)]
pub struct DebugCategory(ptr::NonNull<ffi::GstDebugCategory>); 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 { impl DebugCategory {
pub fn new<'a, P: Into<Option<&'a str>>>( pub fn new<'a, P: Into<Option<&'a str>>>(
name: &str, name: &str,

View file

@ -1187,7 +1187,7 @@ impl<'a> MessageBuilder<'a> {
macro_rules! message_builder_generic_impl { macro_rules! message_builder_generic_impl {
($new_fn:expr) => { ($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 { pub fn src<O: IsA<Object> + Cast + Clone>(self, src: Option<&O>) -> Self {
Self { Self {
builder: self.builder.src(src), 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 { pub fn seqnum(self, seqnum: Seqnum) -> Self {
Self { Self {
builder: self.builder.seqnum(seqnum), builder: self.builder.seqnum(seqnum),
@ -1204,7 +1204,7 @@ macro_rules! message_builder_generic_impl {
} }
#[cfg(any(feature = "v1_14", feature = "dox"))] #[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 { pub fn other_fields(self, other_fields: &[(&'a str, &'a ToSendValue)]) -> Self {
Self { Self {
builder: self.builder.other_fields(other_fields), builder: self.builder.other_fields(other_fields),
@ -2268,7 +2268,7 @@ pub struct RedirectBuilder<'a> {
location: &'a str, location: &'a str,
tag_list: Option<&'a TagList>, tag_list: Option<&'a TagList>,
entry_struct: Option<Structure>, 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>)]>, entries: Option<&'a [(&'a str, Option<&'a TagList>, Option<&'a Structure>)]>,
} }
#[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg(any(feature = "v1_10", feature = "dox"))]

View file

@ -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> { 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 = ( type Storage = (
Vec<Stash<'a, *mut T::GstType, GstRc<T>>>, Vec<Stash<'a, *mut T::GstType, GstRc<T>>>,
Option<Vec<*mut T::GstType>>, 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> impl<'a, T: MiniObject + 'static> ToGlibContainerFromSlice<'a, *const *mut T::GstType>
for GstRc<T> for GstRc<T>
{ {
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] #[allow(clippy::type_complexity)]
type Storage = ( type Storage = (
Vec<Stash<'a, *mut T::GstType, GstRc<T>>>, Vec<Stash<'a, *mut T::GstType, GstRc<T>>>,
Option<Vec<*mut T::GstType>>, 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 { 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 = ( type Storage = (
Vec<$crate::glib::translate::Stash<'a, *mut $ffi_name, $name>>, Vec<$crate::glib::translate::Stash<'a, *mut $ffi_name, $name>>,
Option<Vec<*mut $ffi_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> impl<'a> $crate::glib::translate::ToGlibContainerFromSlice<'a, *const *mut $ffi_name>
for $name for $name
{ {
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] #[allow(clippy::type_complexity)]
type Storage = ( type Storage = (
Vec<$crate::glib::translate::Stash<'a, *mut $ffi_name, $name>>, Vec<$crate::glib::translate::Stash<'a, *mut $ffi_name, $name>>,
Option<Vec<*mut $ffi_name>>, Option<Vec<*mut $ffi_name>>,
@ -844,7 +844,7 @@ macro_rules! gst_define_mini_object_wrapper(
type Owned = $name; type Owned = $name;
fn to_owned(&self) -> $name { fn to_owned(&self) -> $name {
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] #[allow(clippy::cast_ptr_alignment)]
unsafe { unsafe {
$name($crate::glib::translate::from_glib_none($crate::miniobject::MiniObject::as_ptr(self))) $name($crate::glib::translate::from_glib_none($crate::miniobject::MiniObject::as_ptr(self)))
} }

View file

@ -516,7 +516,7 @@ impl<O: IsA<Pad>> PadExtManual for O {
where where
F: Fn(&Self, &Option<::Object>) -> Result<(), LoggableError> + Send + Sync + 'static, F: Fn(&Self, &Option<::Object>) -> Result<(), LoggableError> + Send + Sync + 'static,
{ {
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] #[allow(clippy::type_complexity)]
unsafe { unsafe {
let func_box: Box<F> = Box::new(func); let func_box: Box<F> = Box::new(func);
ffi::gst_pad_set_activate_function_full( ffi::gst_pad_set_activate_function_full(
@ -535,7 +535,7 @@ impl<O: IsA<Pad>> PadExtManual for O {
+ Sync + Sync
+ 'static, + 'static,
{ {
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))] #[allow(clippy::type_complexity)]
unsafe { unsafe {
let func_box: Box<F> = Box::new(func); let func_box: Box<F> = Box::new(func);
ffi::gst_pad_set_activatemode_function_full( 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 { 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)); let func: Box<RefCell<F>> = Box::new(RefCell::new(func));
Box::into_raw(func) as gpointer Box::into_raw(func) as gpointer
} }

View file

@ -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>>( pub fn do_seek<V: Into<T>>(
&mut self, &mut self,
rate: f64, rate: f64,
@ -367,7 +367,7 @@ impl<T: FormattedValue> FormattedSegment<T> {
self.0.rate self.0.rate
} }
#[cfg_attr(feature = "cargo-clippy", allow(float_cmp))] #[allow(clippy::float_cmp)]
pub fn set_rate(&mut self, rate: f64) { pub fn set_rate(&mut self, rate: f64) {
assert_ne!(rate, 0.0); assert_ne!(rate, 0.0);
self.0.rate = rate; self.0.rate = rate;
@ -377,7 +377,7 @@ impl<T: FormattedValue> FormattedSegment<T> {
self.0.applied_rate 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) { pub fn set_applied_rate(&mut self, applied_rate: f64) {
assert_ne!(applied_rate, 0.0); assert_ne!(applied_rate, 0.0);
self.0.applied_rate = applied_rate; self.0.applied_rate = applied_rate;

View file

@ -20,7 +20,7 @@ macro_rules! gst_panic_to_error(
use std::sync::atomic::Ordering; use std::sync::atomic::Ordering;
use $crate::ElementExtManual; use $crate::ElementExtManual;
#[cfg_attr(feature = "cargo-clippy", allow(unused_unit))] #[allow(clippy::unused_unit)]
{ {
if $panicked.load(Ordering::Relaxed) { if $panicked.load(Ordering::Relaxed) {
$element.post_error_message(&gst_error_msg!($crate::LibraryError::Failed, ["Panicked"])); $element.post_error_message(&gst_error_msg!($crate::LibraryError::Failed, ["Panicked"]));

View file

@ -6,7 +6,7 @@
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] #![allow(clippy::cast_ptr_alignment)]
#[macro_use] #[macro_use]
pub mod error; pub mod error;

View file

@ -12,7 +12,7 @@ use glib_ffi;
pub struct MutexGuard<'a>(&'a glib_ffi::GMutex); pub struct MutexGuard<'a>(&'a glib_ffi::GMutex);
impl<'a> MutexGuard<'a> { 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 { pub fn lock(mutex: &'a glib_ffi::GMutex) -> Self {
unsafe { unsafe {
glib_ffi::g_mutex_lock(mut_override(mutex)); glib_ffi::g_mutex_lock(mut_override(mutex));

View file

@ -565,7 +565,7 @@ impl<'a> FromValue<'a> for Array<'a> {
if arr.is_null() { if arr.is_null() {
Array(Cow::Borrowed(&[])) Array(Cow::Borrowed(&[]))
} else { } else {
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] #[allow(clippy::cast_ptr_alignment)]
Array(Cow::Borrowed(slice::from_raw_parts( Array(Cow::Borrowed(slice::from_raw_parts(
(*arr).data as *const glib::SendValue, (*arr).data as *const glib::SendValue,
(*arr).len as usize, (*arr).len as usize,
@ -643,7 +643,7 @@ impl<'a> FromValue<'a> for List<'a> {
if arr.is_null() { if arr.is_null() {
List(Cow::Borrowed(&[])) List(Cow::Borrowed(&[]))
} else { } else {
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] #[allow(clippy::cast_ptr_alignment)]
List(Cow::Borrowed(slice::from_raw_parts( List(Cow::Borrowed(slice::from_raw_parts(
(*arr).data as *const glib::SendValue, (*arr).data as *const glib::SendValue,
(*arr).len as usize, (*arr).len as usize,

View file

@ -221,7 +221,7 @@ mod tutorial5 {
) -> *mut c_void; ) -> *mut c_void;
} }
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] #[allow(clippy::cast_ptr_alignment)]
unsafe { unsafe {
let xid = gdk_x11_window_get_xid(gdk_window.as_ptr() as *mut _); let xid = gdk_x11_window_get_xid(gdk_window.as_ptr() as *mut _);
video_overlay.set_window_handle(xid as usize); video_overlay.set_window_handle(xid as usize);
@ -238,7 +238,7 @@ mod tutorial5 {
) -> *mut c_void; ) -> *mut c_void;
} }
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))] #[allow(clippy::cast_ptr_alignment)]
unsafe { unsafe {
let window = gdk_quartz_window_get_nsview(gdk_window.as_ptr() as *mut _); let window = gdk_quartz_window_get_nsview(gdk_window.as_ptr() as *mut _);
video_overlay.set_window_handle(window as usize); video_overlay.set_window_handle(window as usize);