Fix/silence various 1.72 clippy warnings

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1306>
This commit is contained in:
Sebastian Dröge 2023-08-22 10:00:35 +03:00 committed by GStreamer Marge Bot
parent f4486f5d61
commit 83a562e227
22 changed files with 69 additions and 42 deletions

View file

@ -29,7 +29,7 @@ pub trait AudioVisualizerExtManual:
fn set_req_spf(&self, spf: u32, token: &AudioVisualizerSetupToken) { fn set_req_spf(&self, spf: u32, token: &AudioVisualizerSetupToken) {
assert_eq!( assert_eq!(
self.as_ptr() as *mut ffi::GstAudioVisualizer, self.as_ptr() as *mut ffi::GstAudioVisualizer,
token.0.as_ptr() as *mut ffi::GstAudioVisualizer token.0.as_ptr()
); );
let sinkpad = self.static_pad("sink").expect("sink pad presence"); let sinkpad = self.static_pad("sink").expect("sink pad presence");

View file

@ -37,7 +37,7 @@ pub trait AudioVisualizerImplExt: sealed::Sealed + ObjectSubclass {
fn parent_setup(&self, token: &AudioVisualizerSetupToken) -> Result<(), LoggableError> { fn parent_setup(&self, token: &AudioVisualizerSetupToken) -> Result<(), LoggableError> {
assert_eq!( assert_eq!(
self.obj().as_ptr() as *mut ffi::GstAudioVisualizer, self.obj().as_ptr() as *mut ffi::GstAudioVisualizer,
token.0.as_ptr() as *mut ffi::GstAudioVisualizer token.0.as_ptr()
); );
unsafe { unsafe {

View file

@ -659,6 +659,7 @@ macro_rules! define_iter(
} }
impl<'a> $name<'a> { impl<'a> $name<'a> {
#[allow(clippy::redundant_closure_call)]
fn new(media: &'a SDPMediaRef) -> $name<'a> { fn new(media: &'a SDPMediaRef) -> $name<'a> {
skip_assert_initialized!(); skip_assert_initialized!();
let len = $get_len(media); let len = $get_len(media);
@ -671,6 +672,7 @@ macro_rules! define_iter(
} }
} }
#[allow(clippy::redundant_closure_call)]
impl<'a> Iterator for $name<'a> { impl<'a> Iterator for $name<'a> {
type Item = $typ; type Item = $typ;
@ -715,6 +717,7 @@ macro_rules! define_iter(
} }
} }
#[allow(clippy::redundant_closure_call)]
impl<'a> DoubleEndedIterator for $name<'a> { impl<'a> DoubleEndedIterator for $name<'a> {
fn next_back(&mut self) -> Option<Self::Item> { fn next_back(&mut self) -> Option<Self::Item> {
if self.idx == self.len { if self.idx == self.len {

View file

@ -190,7 +190,7 @@ impl SDPMessageRef {
#[doc(alias = "gst_sdp_message_add_media")] #[doc(alias = "gst_sdp_message_add_media")]
pub fn add_media(&mut self, media: SDPMedia) { pub fn add_media(&mut self, media: SDPMedia) {
unsafe { unsafe {
ffi::gst_sdp_message_add_media(&mut self.0, media.as_ptr() as *mut ffi::GstSDPMedia); ffi::gst_sdp_message_add_media(&mut self.0, media.as_ptr());
} }
} }
@ -1013,6 +1013,7 @@ macro_rules! define_iter(
len: usize, len: usize,
} }
#[allow(clippy::redundant_closure_call)]
impl<'a> $name<'a> { impl<'a> $name<'a> {
fn new(message: &'a SDPMessageRef) -> $name<'a> { fn new(message: &'a SDPMessageRef) -> $name<'a> {
skip_assert_initialized!(); skip_assert_initialized!();
@ -1026,6 +1027,7 @@ macro_rules! define_iter(
} }
} }
#[allow(clippy::redundant_closure_call)]
impl<'a> Iterator for $name<'a> { impl<'a> Iterator for $name<'a> {
type Item = $typ; type Item = $typ;
@ -1069,6 +1071,7 @@ macro_rules! define_iter(
} }
} }
#[allow(clippy::redundant_closure_call)]
impl<'a> DoubleEndedIterator for $name<'a> { impl<'a> DoubleEndedIterator for $name<'a> {
fn next_back(&mut self) -> Option<Self::Item> { fn next_back(&mut self) -> Option<Self::Item> {
if self.idx == self.len { if self.idx == self.len {
@ -1106,6 +1109,7 @@ macro_rules! define_iter_mut(
len: usize, len: usize,
} }
#[allow(clippy::redundant_closure_call)]
impl<'a> $name<'a> { impl<'a> $name<'a> {
fn new(message: &'a mut SDPMessageRef) -> $name<'a> { fn new(message: &'a mut SDPMessageRef) -> $name<'a> {
skip_assert_initialized!(); skip_assert_initialized!();
@ -1119,6 +1123,7 @@ macro_rules! define_iter_mut(
} }
} }
#[allow(clippy::redundant_closure_call)]
impl<'a> Iterator for $name<'a> { impl<'a> Iterator for $name<'a> {
type Item = $typ; type Item = $typ;
@ -1178,6 +1183,7 @@ macro_rules! define_iter_mut(
} }
} }
#[allow(clippy::redundant_closure_call)]
impl<'a> DoubleEndedIterator for $name<'a> { impl<'a> DoubleEndedIterator for $name<'a> {
fn next_back(&mut self) -> Option<Self::Item> { fn next_back(&mut self) -> Option<Self::Item> {
let message = unsafe { let message = unsafe {

View file

@ -199,7 +199,7 @@ impl<'a> ActionTypeBuilder<'a> {
) -> c_int { ) -> c_int {
let action_type = ffi::gst_validate_get_action_type((*action).type_); let action_type = ffi::gst_validate_get_action_type((*action).type_);
let scenario = from_glib_borrow(scenario); let scenario = from_glib_borrow(scenario);
let action = crate::ActionRef::from_mut_ptr(action as *mut ffi::GstValidateAction); let action = crate::ActionRef::from_mut_ptr(action);
let func: &ActionFunction = &*(gst::ffi::gst_mini_object_get_qdata( let func: &ActionFunction = &*(gst::ffi::gst_mini_object_get_qdata(
action_type as *mut gst::ffi::GstMiniObject, action_type as *mut gst::ffi::GstMiniObject,

View file

@ -64,7 +64,7 @@ pub trait VideoAggregatorImplExt: sealed::Sealed + ObjectSubclass {
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
assert_eq!( assert_eq!(
self.obj().as_ptr() as *mut ffi::GstVideoAggregator, self.obj().as_ptr() as *mut ffi::GstVideoAggregator,
token.0.as_ptr() as *mut ffi::GstVideoAggregator token.0.as_ptr()
); );
unsafe { unsafe {

View file

@ -58,8 +58,8 @@ pub trait VideoAggregatorPadImplExt: ObjectSubclass {
buffer: &gst::Buffer, buffer: &gst::Buffer,
) -> Option<crate::VideoFrame<crate::video_frame::Readable>> { ) -> Option<crate::VideoFrame<crate::video_frame::Readable>> {
assert_eq!( assert_eq!(
aggregator.as_ptr() as *mut ffi::GstVideoAggregator, aggregator.as_ptr(),
token.0.as_ptr() as *mut ffi::GstVideoAggregator token.0.as_ptr()
); );
unsafe { unsafe {
@ -97,8 +97,8 @@ pub trait VideoAggregatorPadImplExt: ObjectSubclass {
frame: Option<crate::VideoFrame<crate::video_frame::Readable>>, frame: Option<crate::VideoFrame<crate::video_frame::Readable>>,
) { ) {
assert_eq!( assert_eq!(
aggregator.as_ptr() as *mut ffi::GstVideoAggregator, aggregator.as_ptr(),
token.0.as_ptr() as *mut ffi::GstVideoAggregator token.0.as_ptr()
); );
unsafe { unsafe {

View file

@ -42,6 +42,7 @@ macro_rules! event_builder_generic_impl {
} }
#[must_use = "Building the event without using it has no effect"] #[must_use = "Building the event without using it has no effect"]
#[allow(clippy::redundant_closure_call)]
pub fn build(mut self) -> gst::Event { pub fn build(mut self) -> gst::Event {
skip_assert_initialized!(); skip_assert_initialized!();
unsafe { unsafe {

View file

@ -237,7 +237,7 @@ impl VideoFormatInfo {
unsafe { unsafe {
use std::ptr; use std::ptr;
let mut src_ptr = [ptr::null() as *const u8; ffi::GST_VIDEO_MAX_PLANES as usize]; let mut src_ptr = [ptr::null(); ffi::GST_VIDEO_MAX_PLANES as usize];
for plane in 0..(self.n_planes()) { for plane in 0..(self.n_planes()) {
src_ptr[plane as usize] = src[plane as usize].as_ptr(); src_ptr[plane as usize] = src[plane as usize].as_ptr();
} }
@ -247,7 +247,7 @@ impl VideoFormatInfo {
flags.into_glib(), flags.into_glib(),
dest.as_mut_ptr() as *mut _, dest.as_mut_ptr() as *mut _,
src_ptr.as_ptr() as *const _, src_ptr.as_ptr() as *const _,
stride.as_ptr() as *const i32, stride.as_ptr(),
x, x,
y, y,
width, width,
@ -313,7 +313,7 @@ impl VideoFormatInfo {
unsafe { unsafe {
use std::ptr; use std::ptr;
let mut dest_ptr = [ptr::null_mut() as *mut u8; ffi::GST_VIDEO_MAX_PLANES as usize]; let mut dest_ptr = [ptr::null_mut(); ffi::GST_VIDEO_MAX_PLANES as usize];
for plane in 0..(self.n_planes()) { for plane in 0..(self.n_planes()) {
dest_ptr[plane as usize] = dest[plane as usize].as_mut_ptr(); dest_ptr[plane as usize] = dest[plane as usize].as_mut_ptr();
} }
@ -324,7 +324,7 @@ impl VideoFormatInfo {
src.as_ptr() as *mut _, src.as_ptr() as *mut _,
src_stride, src_stride,
dest_ptr.as_mut_ptr() as *mut _, dest_ptr.as_mut_ptr() as *mut _,
dest_stride.as_ptr() as *const i32, dest_stride.as_ptr(),
chroma_site.into_glib(), chroma_site.into_glib(),
y, y,
width, width,

View file

@ -41,6 +41,7 @@ macro_rules! message_builder_generic_impl {
} }
#[must_use = "Building the message without using it has no effect"] #[must_use = "Building the message without using it has no effect"]
#[allow(clippy::redundant_closure_call)]
pub fn build(mut self) -> Message { pub fn build(mut self) -> Message {
skip_assert_initialized!(); skip_assert_initialized!();
unsafe { unsafe {

View file

@ -803,6 +803,7 @@ macro_rules! define_meta_iter(
} }
} }
#[allow(clippy::redundant_closure_call)]
impl<'a, T: MetaAPI> Iterator for $name<'a, T> { impl<'a, T: MetaAPI> Iterator for $name<'a, T> {
type Item = $mtyp; type Item = $mtyp;
@ -875,6 +876,7 @@ macro_rules! define_iter(
} }
} }
#[allow(clippy::redundant_closure_call)]
impl<'a> Iterator for $name<'a> { impl<'a> Iterator for $name<'a> {
type Item = $mtyp; type Item = $mtyp;
@ -927,6 +929,7 @@ macro_rules! define_iter(
} }
} }
#[allow(clippy::redundant_closure_call)]
impl<'a> DoubleEndedIterator for $name<'a> { impl<'a> DoubleEndedIterator for $name<'a> {
fn next_back(&mut self) -> Option<Self::Item> { fn next_back(&mut self) -> Option<Self::Item> {
if self.idx == self.n_memory { if self.idx == self.n_memory {
@ -984,7 +987,7 @@ define_iter!(
if ptr.is_null() { if ptr.is_null() {
None None
} else { } else {
Some(MemoryRef::from_mut_ptr(ptr as *mut ffi::GstMemory)) Some(MemoryRef::from_mut_ptr(ptr))
} }
} }
); );
@ -1149,7 +1152,7 @@ impl<'a, T> BufferMap<'a, T> {
if self.map_info.size == 0 { if self.map_info.size == 0 {
return &[]; return &[];
} }
unsafe { slice::from_raw_parts(self.map_info.data as *const u8, self.map_info.size) } unsafe { slice::from_raw_parts(self.map_info.data, self.map_info.size) }
} }
} }
@ -1159,7 +1162,7 @@ impl<'a> BufferMap<'a, Writable> {
if self.map_info.size == 0 { if self.map_info.size == 0 {
return &mut []; return &mut [];
} }
unsafe { slice::from_raw_parts_mut(self.map_info.data as *mut u8, self.map_info.size) } unsafe { slice::from_raw_parts_mut(self.map_info.data, self.map_info.size) }
} }
} }
@ -1225,7 +1228,7 @@ impl<T> MappedBuffer<T> {
if self.map_info.size == 0 { if self.map_info.size == 0 {
return &[]; return &[];
} }
unsafe { slice::from_raw_parts(self.map_info.data as *const u8, self.map_info.size) } unsafe { slice::from_raw_parts(self.map_info.data, self.map_info.size) }
} }
#[doc(alias = "get_size")] #[doc(alias = "get_size")]
@ -1258,7 +1261,7 @@ impl MappedBuffer<Writable> {
if self.map_info.size == 0 { if self.map_info.size == 0 {
return &mut []; return &mut [];
} }
unsafe { slice::from_raw_parts_mut(self.map_info.data as *mut u8, self.map_info.size) } unsafe { slice::from_raw_parts_mut(self.map_info.data, self.map_info.size) }
} }
} }

View file

@ -98,7 +98,9 @@ macro_rules! define_seek_impl(
); );
macro_rules! define_read_write_fn_impl( macro_rules! define_read_write_fn_impl(
($self:ident, $data:ident, $data_type:ty, $get_buffer_ref:expr, $map_flags:path, $copy:expr, $split:expr) => {{ ($self:ident, $data:ident, $data_type:ty, $get_buffer_ref:expr, $map_flags:path, $copy:expr, $split:expr) => {
#[allow(clippy::redundant_closure_call)]
{
let mut copied = 0; let mut copied = 0;
while !$data.is_empty() && $self.cur_mem_idx < $self.num_mem { while !$data.is_empty() && $self.cur_mem_idx < $self.num_mem {

View file

@ -2,7 +2,7 @@
use std::{fmt, ops::ControlFlow, ptr}; use std::{fmt, ops::ControlFlow, ptr};
use glib::translate::{from_glib, from_glib_full, from_glib_none, IntoGlib, IntoGlibPtr}; use glib::translate::*;
use crate::{Buffer, BufferRef}; use crate::{Buffer, BufferRef};
@ -140,9 +140,10 @@ impl BufferListRef {
) -> glib::ffi::gboolean { ) -> glib::ffi::gboolean {
let func = user_data as *const _ as usize as *mut F; let func = user_data as *const _ as usize as *mut F;
let res = (*func)( let res = (*func)(
Buffer::from_glib_full( Buffer::from_glib_full(ptr::replace(
ptr::replace(buffer, ptr::null_mut::<ffi::GstBuffer>()) as *mut ffi::GstBuffer buffer as *mut *const ffi::GstBuffer,
), ptr::null_mut::<ffi::GstBuffer>(),
)),
idx, idx,
); );
@ -227,6 +228,7 @@ macro_rules! define_iter(
} }
} }
#[allow(clippy::redundant_closure_call)]
impl<'a> Iterator for $name<'a> { impl<'a> Iterator for $name<'a> {
type Item = $styp; type Item = $styp;
@ -271,6 +273,7 @@ macro_rules! define_iter(
} }
} }
#[allow(clippy::redundant_closure_call)]
impl<'a> DoubleEndedIterator for $name<'a> { impl<'a> DoubleEndedIterator for $name<'a> {
fn next_back(&mut self) -> Option<Self::Item> { fn next_back(&mut self) -> Option<Self::Item> {
if self.idx == self.size { if self.idx == self.size {

View file

@ -726,6 +726,7 @@ macro_rules! define_iter(
} }
} }
#[allow(clippy::redundant_closure_call)]
impl<'a> Iterator for $name<'a> { impl<'a> Iterator for $name<'a> {
type Item = $styp; type Item = $styp;
@ -775,6 +776,7 @@ macro_rules! define_iter(
} }
} }
#[allow(clippy::redundant_closure_call)]
impl<'a> DoubleEndedIterator for $name<'a> { impl<'a> DoubleEndedIterator for $name<'a> {
fn next_back(&mut self) -> Option<Self::Item> { fn next_back(&mut self) -> Option<Self::Item> {
if self.idx == self.n_structures { if self.idx == self.n_structures {
@ -832,9 +834,7 @@ define_iter!(
if ptr.is_null() { if ptr.is_null() {
None None
} else { } else {
Some(StructureRef::from_glib_borrow_mut( Some(StructureRef::from_glib_borrow_mut(ptr))
ptr as *mut ffi::GstStructure,
))
} }
} }
); );
@ -849,8 +849,8 @@ define_iter!(
None None
} else { } else {
Some(( Some((
StructureRef::from_glib_borrow(ptr1 as *const ffi::GstStructure), StructureRef::from_glib_borrow(ptr1),
CapsFeaturesRef::from_glib_borrow(ptr2 as *const ffi::GstCapsFeatures), CapsFeaturesRef::from_glib_borrow(ptr2),
)) ))
} }
} }
@ -866,8 +866,8 @@ define_iter!(
None None
} else { } else {
Some(( Some((
StructureRef::from_glib_borrow_mut(ptr1 as *mut ffi::GstStructure), StructureRef::from_glib_borrow_mut(ptr1),
CapsFeaturesRef::from_glib_borrow_mut(ptr2 as *mut ffi::GstCapsFeatures), CapsFeaturesRef::from_glib_borrow_mut(ptr2),
)) ))
} }
} }

View file

@ -2111,6 +2111,7 @@ macro_rules! event_builder_generic_impl {
} }
#[must_use = "Building the event without using it has no effect"] #[must_use = "Building the event without using it has no effect"]
#[allow(clippy::redundant_closure_call)]
pub fn build(mut self) -> Event { pub fn build(mut self) -> Event {
unsafe { unsafe {
let event = $new_fn(&mut self); let event = $new_fn(&mut self);

View file

@ -1425,6 +1425,7 @@ macro_rules! impl_signed_extra_div_mul(
macro_rules! impl_signed_div_mul_trait( macro_rules! impl_signed_div_mul_trait(
($typ:ty, $inner:ty, $signed_rhs:ty, $into_inner:expr) => { ($typ:ty, $inner:ty, $signed_rhs:ty, $into_inner:expr) => {
#[allow(clippy::redundant_closure_call)]
impl muldiv::MulDiv<$signed_rhs> for crate::Signed<$typ> { impl muldiv::MulDiv<$signed_rhs> for crate::Signed<$typ> {
type Output = Self; type Output = Self;
@ -1480,6 +1481,7 @@ macro_rules! impl_signed_div_mul_trait(
} }
} }
#[allow(clippy::redundant_closure_call)]
impl muldiv::MulDiv<$inner> for crate::Signed<$typ> { impl muldiv::MulDiv<$inner> for crate::Signed<$typ> {
type Output = Self; type Output = Self;
@ -1802,6 +1804,7 @@ macro_rules! impl_signed_int_into_signed(
}; };
($typ:ty, $inner:ty, $signed:ty, $into_inner:expr) => { ($typ:ty, $inner:ty, $signed:ty, $into_inner:expr) => {
#[allow(clippy::redundant_closure_call)]
impl TryFrom<crate::Signed<$typ>> for $signed { impl TryFrom<crate::Signed<$typ>> for $signed {
type Error = std::num::TryFromIntError; type Error = std::num::TryFromIntError;

View file

@ -1145,7 +1145,7 @@ impl fmt::Display for LoggedObject {
let parent_name = if parent_ptr.is_null() { let parent_name = if parent_ptr.is_null() {
"<null>" "<null>"
} else { } else {
let name_ptr = (*(parent_ptr as *mut ffi::GstObject)).name; let name_ptr = (*(parent_ptr)).name;
if name_ptr.is_null() { if name_ptr.is_null() {
"<null>" "<null>"
} else { } else {

View file

@ -353,7 +353,7 @@ impl<'a, T> MemoryMap<'a, T> {
if self.map_info.size == 0 { if self.map_info.size == 0 {
return &[]; return &[];
} }
unsafe { slice::from_raw_parts(self.map_info.data as *const u8, self.map_info.size) } unsafe { slice::from_raw_parts(self.map_info.data, self.map_info.size) }
} }
} }
@ -363,7 +363,7 @@ impl<'a> MemoryMap<'a, Writable> {
if self.map_info.size == 0 { if self.map_info.size == 0 {
return &mut []; return &mut [];
} }
unsafe { slice::from_raw_parts_mut(self.map_info.data as *mut u8, self.map_info.size) } unsafe { slice::from_raw_parts_mut(self.map_info.data, self.map_info.size) }
} }
} }
@ -429,7 +429,7 @@ impl<T> MappedMemory<T> {
if self.map_info.size == 0 { if self.map_info.size == 0 {
return &[]; return &[];
} }
unsafe { slice::from_raw_parts(self.map_info.data as *const u8, self.map_info.size) } unsafe { slice::from_raw_parts(self.map_info.data, self.map_info.size) }
} }
#[doc(alias = "get_size")] #[doc(alias = "get_size")]
@ -462,7 +462,7 @@ impl MappedMemory<Writable> {
if self.map_info.size == 0 { if self.map_info.size == 0 {
return &mut []; return &mut [];
} }
unsafe { slice::from_raw_parts_mut(self.map_info.data as *mut u8, self.map_info.size) } unsafe { slice::from_raw_parts_mut(self.map_info.data, self.map_info.size) }
} }
} }
@ -974,6 +974,6 @@ mod tests {
let mem = crate::Memory::from_slice(vec![1, 2, 3, 4]); let mem = crate::Memory::from_slice(vec![1, 2, 3, 4]);
let v = mem.to_value(); let v = mem.to_value();
assert!(matches!(v.get::<Option<crate::Memory>>(), Ok(Some(_)))); assert!(matches!(v.get::<Option<crate::Memory>>(), Ok(Some(_))));
assert!(matches!(v.get::<crate::Memory>(), Ok(_))); assert!(v.get::<crate::Memory>().is_ok());
} }
} }

View file

@ -2545,6 +2545,7 @@ macro_rules! message_builder_generic_impl {
} }
#[must_use = "Building the message without using it has no effect"] #[must_use = "Building the message without using it has no effect"]
#[allow(clippy::redundant_closure_call)]
pub fn build(mut self) -> Message { pub fn build(mut self) -> Message {
unsafe { unsafe {
let src = self.builder.src.to_glib_none().0; let src = self.builder.src.to_glib_none().0;

View file

@ -508,6 +508,7 @@ macro_rules! mini_object_wrapper (
} }
} }
#[allow(clippy::redundant_closure_call)]
impl $crate::glib::types::StaticType for $ref_name { impl $crate::glib::types::StaticType for $ref_name {
#[inline] #[inline]
fn static_type() -> $crate::glib::types::Type { fn static_type() -> $crate::glib::types::Type {

View file

@ -52,6 +52,7 @@ impl<'a> TagValuesSer<'a> {
} }
impl<'a> Serialize for TagValuesSer<'a> { impl<'a> Serialize for TagValuesSer<'a> {
#[allow(clippy::redundant_closure_call)]
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> { fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
use std::ops::DerefMut; use std::ops::DerefMut;

View file

@ -47,23 +47,24 @@ impl<'de> Deserialize<'de> for Fraction {
} }
macro_rules! ser_some_value ( macro_rules! ser_some_value (
($value:expr, $t:ty, $ser_closure:expr) => ( ($value:expr, $t:ty, $ser_closure:expr) => {
{ {
let value = $value.get::<$t>().expect("ser_some_value macro"); let value = $value.get::<$t>().expect("ser_some_value macro");
$ser_closure(stringify!($t), value) $ser_closure(stringify!($t), value)
} }
); }
); );
macro_rules! ser_opt_value ( macro_rules! ser_opt_value (
($value:expr, $t:ty, $ser_closure:expr) => ( ($value:expr, $t:ty, $ser_closure:expr) => {
{ {
let value = $value.get::<Option<$t>>().expect("ser_opt_value macro"); let value = $value.get::<Option<$t>>().expect("ser_opt_value macro");
$ser_closure(stringify!($t), value) $ser_closure(stringify!($t), value)
} }
); }
); );
macro_rules! ser_value ( macro_rules! ser_value (
($value:expr, $ser_closure:expr) => ( ($value:expr, $ser_closure:expr) => {
#[allow(clippy::redundant_closure_call)]
match $value.type_() { match $value.type_() {
glib::Type::I8 => ser_some_value!($value, i8, $ser_closure), glib::Type::I8 => ser_some_value!($value, i8, $ser_closure),
glib::Type::U8 => ser_some_value!($value, u8, $ser_closure), glib::Type::U8 => ser_some_value!($value, u8, $ser_closure),
@ -115,7 +116,7 @@ macro_rules! ser_value (
} }
} }
} }
); }
); );
#[repr(transparent)] #[repr(transparent)]