From 01e24d20185e6b701021d8de46e82fc3a5d7d130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 1 Nov 2022 11:10:57 +0200 Subject: [PATCH] Fix various new clippy warnings --- examples/src/bin/cairo_compositor.rs | 2 +- examples/src/bin/custom_events.rs | 2 +- examples/src/bin/overlay-composition.rs | 4 +- examples/src/bin/pango-cairo.rs | 4 +- gstreamer-audio/src/audio_converter.rs | 12 ++--- gstreamer-base/src/subclass/base_src.rs | 4 +- gstreamer-base/src/subclass/push_src.rs | 4 +- gstreamer-check/src/harness.rs | 6 +-- gstreamer-play/src/config.rs | 2 +- gstreamer-player/src/config.rs | 2 +- .../src/subclass/video_aggregator_pad.rs | 4 +- gstreamer-video/src/video_converter.rs | 44 +++++++++---------- gstreamer/src/caps.rs | 14 +++--- gstreamer/src/caps_serde.rs | 18 ++++---- gstreamer/src/event.rs | 2 +- gstreamer/src/pad.rs | 2 +- gstreamer/src/query.rs | 2 +- gstreamer/src/structure.rs | 8 ++-- gstreamer/src/structure_serde.rs | 6 +-- gstreamer/src/tags.rs | 6 +-- gstreamer/src/typefind.rs | 2 +- gstreamer/src/value_serde.rs | 8 ++-- 22 files changed, 77 insertions(+), 81 deletions(-) diff --git a/examples/src/bin/cairo_compositor.rs b/examples/src/bin/cairo_compositor.rs index 3ba9b6a1b..9cc2b26cf 100644 --- a/examples/src/bin/cairo_compositor.rs +++ b/examples/src/bin/cairo_compositor.rs @@ -69,7 +69,7 @@ mod cairo_compositor { .build()] }); - &*PROPERTIES + &PROPERTIES } // Called by the application whenever the value of a property should be changed. diff --git a/examples/src/bin/custom_events.rs b/examples/src/bin/custom_events.rs index c9e97f442..704ca3c01 100644 --- a/examples/src/bin/custom_events.rs +++ b/examples/src/bin/custom_events.rs @@ -21,7 +21,7 @@ impl ExampleCustomEvent { #[allow(clippy::new_ret_no_self)] pub fn new(send_eos: bool) -> gst::Event { let s = gst::Structure::builder(Self::EVENT_NAME) - .field("send_eos", &send_eos) + .field("send_eos", send_eos) .build(); gst::event::CustomDownstream::new(s) } diff --git a/examples/src/bin/overlay-composition.rs b/examples/src/bin/overlay-composition.rs index f449e3000..7163aa1de 100644 --- a/examples/src/bin/overlay-composition.rs +++ b/examples/src/bin/overlay-composition.rs @@ -178,7 +178,7 @@ fn create_pipeline() -> Result { // Update the text layout. This function is only updating pango's internal state. // So e.g. that after a 90 degree rotation it knows that what was previously going // to end up as a 200x100 rectangle would now be 100x200. - pangocairo::functions::update_layout(&cr, &**layout); + pangocairo::functions::update_layout(&cr, layout); let (width, _height) = layout.size(); // Using width and height of the text, we can properly possition it within // our canvas. @@ -188,7 +188,7 @@ fn create_pipeline() -> Result { ); // After telling the layout object where to draw itself, we actually tell // it to draw itself into our cairo context. - pangocairo::functions::show_layout(&cr, &**layout); + pangocairo::functions::show_layout(&cr, layout); // Here we go one step up in our stack of transformations, removing any // changes we did to them since the last call to cr.save(); diff --git a/examples/src/bin/pango-cairo.rs b/examples/src/bin/pango-cairo.rs index 22ca3c119..ba16f4ba2 100644 --- a/examples/src/bin/pango-cairo.rs +++ b/examples/src/bin/pango-cairo.rs @@ -162,7 +162,7 @@ fn create_pipeline() -> Result { // Update the text layout. This function is only updating pango's internal state. // So e.g. that after a 90 degree rotation it knows that what was previously going // to end up as a 200x100 rectangle would now be 100x200. - pangocairo::functions::update_layout(&cr, &**layout); + pangocairo::functions::update_layout(&cr, layout); let (width, _height) = layout.size(); // Using width and height of the text, we can properly possition it within // our canvas. @@ -172,7 +172,7 @@ fn create_pipeline() -> Result { ); // After telling the layout object where to draw itself, we actually tell // it to draw itself into our cairo context. - pangocairo::functions::show_layout(&cr, &**layout); + pangocairo::functions::show_layout(&cr, layout); // Here we go one step up in our stack of transformations, removing any // changes we did to them since the last call to cr.save(); diff --git a/gstreamer-audio/src/audio_converter.rs b/gstreamer-audio/src/audio_converter.rs index 04d2546e5..7c037f5f5 100644 --- a/gstreamer-audio/src/audio_converter.rs +++ b/gstreamer-audio/src/audio_converter.rs @@ -74,7 +74,7 @@ impl AudioConverterConfig { } pub fn set_dither_method(&mut self, v: crate::AudioDitherMethod) { - self.0.set("GstAudioConverter.dither-method", &v); + self.0.set("GstAudioConverter.dither-method", v); } #[doc(alias = "get_dither_method")] @@ -86,7 +86,7 @@ impl AudioConverterConfig { } pub fn set_noise_shaping_method(&mut self, v: crate::AudioNoiseShapingMethod) { - self.0.set("GstAudioConverter.noise-shaping-method", &v); + self.0.set("GstAudioConverter.noise-shaping-method", v); } #[doc(alias = "get_noise_shaping_method")] @@ -98,7 +98,7 @@ impl AudioConverterConfig { } pub fn set_quantization(&mut self, v: u32) { - self.0.set("GstAudioConverter.quantization", &v); + self.0.set("GstAudioConverter.quantization", v); } #[doc(alias = "get_quantization")] @@ -110,7 +110,7 @@ impl AudioConverterConfig { } pub fn set_resampler_method(&mut self, v: crate::AudioResamplerMethod) { - self.0.set("GstAudioConverter.resampler-method", &v); + self.0.set("GstAudioConverter.resampler-method", v); } #[doc(alias = "get_resampler_method")] @@ -128,7 +128,7 @@ impl AudioConverterConfig { assert_eq!(val.len(), length); gst::Array::from_values(val.iter().map(|val| val.to_send_value())).to_send_value() })); - self.0.set("GstAudioConverter.mix-matrix", &array); + self.0.set("GstAudioConverter.mix-matrix", array); } #[doc(alias = "get_mix_matrix")] @@ -157,7 +157,7 @@ impl AudioConverterConfig { #[cfg(any(feature = "v1_22", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))] pub fn set_dither_threshold(&mut self, v: u32) { - self.0.set("GstAudioConverter.dither-threshold", &v); + self.0.set("GstAudioConverter.dither-threshold", v); } #[cfg(any(feature = "v1_22", feature = "dox"))] diff --git a/gstreamer-base/src/subclass/base_src.rs b/gstreamer-base/src/subclass/base_src.rs index 322c084e9..8cf0392d0 100644 --- a/gstreamer-base/src/subclass/base_src.rs +++ b/gstreamer-base/src/subclass/base_src.rs @@ -400,7 +400,7 @@ impl BaseSrcImplExt for T { } }; - let copied_size = new_buffer.copy_to_slice(0, &mut *map); + let copied_size = new_buffer.copy_to_slice(0, &mut map); drop(map); if let Err(copied_size) = copied_size { @@ -821,7 +821,7 @@ unsafe extern "C" fn base_src_create( } }; - let copied_size = new_buffer.copy_to_slice(0, &mut *map); + let copied_size = new_buffer.copy_to_slice(0, &mut map); drop(map); if let Err(copied_size) = copied_size { diff --git a/gstreamer-base/src/subclass/push_src.rs b/gstreamer-base/src/subclass/push_src.rs index 45a6eb515..37e701854 100644 --- a/gstreamer-base/src/subclass/push_src.rs +++ b/gstreamer-base/src/subclass/push_src.rs @@ -156,7 +156,7 @@ impl PushSrcImplExt for T { } }; - let copied_size = new_buffer.copy_to_slice(0, &mut *map); + let copied_size = new_buffer.copy_to_slice(0, &mut map); drop(map); if let Err(copied_size) = copied_size { @@ -282,7 +282,7 @@ unsafe extern "C" fn push_src_create( } }; - let copied_size = new_buffer.copy_to_slice(0, &mut *map); + let copied_size = new_buffer.copy_to_slice(0, &mut map); drop(map); if let Err(copied_size) = copied_size { diff --git a/gstreamer-check/src/harness.rs b/gstreamer-check/src/harness.rs index 07ad61c7b..bfcecd359 100644 --- a/gstreamer-check/src/harness.rs +++ b/gstreamer-check/src/harness.rs @@ -820,7 +820,7 @@ impl<'a> ops::Deref for Ref<'a> { type Target = Harness; fn deref(&self) -> &Harness { - &*self.0 + &self.0 } } @@ -831,13 +831,13 @@ impl<'a> ops::Deref for RefMut<'a> { type Target = Harness; fn deref(&self) -> &Harness { - &*self.0 + &self.0 } } impl<'a> ops::DerefMut for RefMut<'a> { fn deref_mut(&mut self) -> &mut Harness { - &mut *self.0 + &mut self.0 } } diff --git a/gstreamer-play/src/config.rs b/gstreamer-play/src/config.rs index 85ce84d5d..0b6ede3c7 100644 --- a/gstreamer-play/src/config.rs +++ b/gstreamer-play/src/config.rs @@ -74,7 +74,7 @@ impl PlayConfig { assert_initialized_main_thread!(); // FIXME: Work-around for // http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=cc58bd6ae071dec4ea7b4be626034accd0372755 - self.set("accurate-seek", &accurate); + self.set("accurate-seek", accurate); } #[doc(alias = "gst_play_config_set_user_agent")] diff --git a/gstreamer-player/src/config.rs b/gstreamer-player/src/config.rs index 6271de23c..b54a8ace7 100644 --- a/gstreamer-player/src/config.rs +++ b/gstreamer-player/src/config.rs @@ -78,7 +78,7 @@ impl PlayerConfig { assert_initialized_main_thread!(); // FIXME: Work-around for // http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=cc58bd6ae071dec4ea7b4be626034accd0372755 - self.set("accurate-seek", &accurate); + self.set("accurate-seek", accurate); } #[doc(alias = "gst_player_config_set_user_agent")] diff --git a/gstreamer-video/src/subclass/video_aggregator_pad.rs b/gstreamer-video/src/subclass/video_aggregator_pad.rs index a00069058..095a0be7a 100644 --- a/gstreamer-video/src/subclass/video_aggregator_pad.rs +++ b/gstreamer-video/src/subclass/video_aggregator_pad.rs @@ -172,7 +172,7 @@ unsafe extern "C" fn video_aggregator_pad_prepare_frame = from_glib_borrow(aggregator); - let token = AggregateFramesToken(&*aggregator); + let token = AggregateFramesToken(&aggregator); match imp.prepare_frame(&aggregator, &token, &from_glib_borrow(buffer)) { Some(frame) => { @@ -195,7 +195,7 @@ unsafe extern "C" fn video_aggregator_pad_clean_frame let imp = instance.imp(); let aggregator: Borrowed = from_glib_borrow(aggregator); - let token = AggregateFramesToken(&*aggregator); + let token = AggregateFramesToken(&aggregator); let frame = if (*prepared_frame).buffer.is_null() { None diff --git a/gstreamer-video/src/video_converter.rs b/gstreamer-video/src/video_converter.rs index 6612f13c7..7bc1b9a9a 100644 --- a/gstreamer-video/src/video_converter.rs +++ b/gstreamer-video/src/video_converter.rs @@ -180,7 +180,7 @@ impl VideoConverterConfig { } pub fn set_resampler_method(&mut self, v: crate::VideoResamplerMethod) { - self.0.set("GstVideoConverter.resampler-method", &v); + self.0.set("GstVideoConverter.resampler-method", v); } #[doc(alias = "get_resampler_method")] @@ -192,7 +192,7 @@ impl VideoConverterConfig { } pub fn set_chroma_resampler_method(&mut self, v: crate::VideoResamplerMethod) { - self.0.set("GstVideoConverter.chroma-resampler-method", &v); + self.0.set("GstVideoConverter.chroma-resampler-method", v); } #[doc(alias = "get_chroma_resampler_method")] @@ -204,7 +204,7 @@ impl VideoConverterConfig { } pub fn set_resampler_taps(&mut self, v: u32) { - self.0.set("GstVideoConverter.resampler-taps", &v); + self.0.set("GstVideoConverter.resampler-taps", v); } #[doc(alias = "get_resampler_taps")] @@ -216,7 +216,7 @@ impl VideoConverterConfig { } pub fn set_dither_method(&mut self, v: crate::VideoDitherMethod) { - self.0.set("GstVideoConverter.dither-method", &v); + self.0.set("GstVideoConverter.dither-method", v); } #[doc(alias = "get_dither_method")] @@ -228,7 +228,7 @@ impl VideoConverterConfig { } pub fn set_dither_quantization(&mut self, v: u32) { - self.0.set("GstVideoConverter.dither-quantization", &v); + self.0.set("GstVideoConverter.dither-quantization", v); } #[doc(alias = "get_dither_quantization")] @@ -240,7 +240,7 @@ impl VideoConverterConfig { } pub fn set_src_x(&mut self, v: i32) { - self.0.set("GstVideoConverter.src-x", &v); + self.0.set("GstVideoConverter.src-x", v); } #[doc(alias = "get_src_x")] @@ -252,7 +252,7 @@ impl VideoConverterConfig { } pub fn set_src_y(&mut self, v: i32) { - self.0.set("GstVideoConverter.src-y", &v); + self.0.set("GstVideoConverter.src-y", v); } #[doc(alias = "get_src_y")] @@ -265,7 +265,7 @@ impl VideoConverterConfig { pub fn set_src_width(&mut self, v: Option) { if let Some(v) = v { - self.0.set("GstVideoConverter.src-width", &v); + self.0.set("GstVideoConverter.src-width", v); } else { self.0.remove_field("GstVideoConverter.src-width"); } @@ -280,7 +280,7 @@ impl VideoConverterConfig { pub fn set_src_height(&mut self, v: Option) { if let Some(v) = v { - self.0.set("GstVideoConverter.src-height", &v); + self.0.set("GstVideoConverter.src-height", v); } else { self.0.remove_field("GstVideoConverter.src-height"); } @@ -294,7 +294,7 @@ impl VideoConverterConfig { } pub fn set_dest_x(&mut self, v: i32) { - self.0.set("GstVideoConverter.dest-x", &v); + self.0.set("GstVideoConverter.dest-x", v); } #[doc(alias = "get_dest_x")] @@ -306,7 +306,7 @@ impl VideoConverterConfig { } pub fn set_dest_y(&mut self, v: i32) { - self.0.set("GstVideoConverter.dest-y", &v); + self.0.set("GstVideoConverter.dest-y", v); } #[doc(alias = "get_dest_y")] @@ -319,7 +319,7 @@ impl VideoConverterConfig { pub fn set_dest_width(&mut self, v: Option) { if let Some(v) = v { - self.0.set("GstVideoConverter.dest-width", &v); + self.0.set("GstVideoConverter.dest-width", v); } else { self.0.remove_field("GstVideoConverter.dest-width"); } @@ -334,7 +334,7 @@ impl VideoConverterConfig { pub fn set_dest_height(&mut self, v: Option) { if let Some(v) = v { - self.0.set("GstVideoConverter.dest-height", &v); + self.0.set("GstVideoConverter.dest-height", v); } else { self.0.remove_field("GstVideoConverter.dest-height"); } @@ -348,7 +348,7 @@ impl VideoConverterConfig { } pub fn set_fill_border(&mut self, v: bool) { - self.0.set("GstVideoConverter.fill-border", &v); + self.0.set("GstVideoConverter.fill-border", v); } #[doc(alias = "get_fill_border")] @@ -360,7 +360,7 @@ impl VideoConverterConfig { } pub fn set_alpha_value(&mut self, v: f64) { - self.0.set("GstVideoConverter.alpha-value", &v); + self.0.set("GstVideoConverter.alpha-value", v); } #[doc(alias = "get_alpha_value")] @@ -372,7 +372,7 @@ impl VideoConverterConfig { } pub fn set_alpha_mode(&mut self, v: crate::VideoAlphaMode) { - self.0.set("GstVideoConverter.alpha-mode", &v); + self.0.set("GstVideoConverter.alpha-mode", v); } #[doc(alias = "get_alpha_mode")] @@ -384,7 +384,7 @@ impl VideoConverterConfig { } pub fn set_border_argb(&mut self, v: u32) { - self.0.set("GstVideoConverter.border-argb", &v); + self.0.set("GstVideoConverter.border-argb", v); } #[doc(alias = "get_border_argb")] @@ -396,7 +396,7 @@ impl VideoConverterConfig { } pub fn set_chroma_mode(&mut self, v: crate::VideoChromaMode) { - self.0.set("GstVideoConverter.chroma-mode", &v); + self.0.set("GstVideoConverter.chroma-mode", v); } #[doc(alias = "get_chroma_mode")] @@ -408,7 +408,7 @@ impl VideoConverterConfig { } pub fn set_matrix_mode(&mut self, v: crate::VideoMatrixMode) { - self.0.set("GstVideoConverter.matrix-mode", &v); + self.0.set("GstVideoConverter.matrix-mode", v); } #[doc(alias = "get_matrix_mode")] @@ -420,7 +420,7 @@ impl VideoConverterConfig { } pub fn set_gamma_mode(&mut self, v: crate::VideoGammaMode) { - self.0.set("GstVideoConverter.gamma-mode", &v); + self.0.set("GstVideoConverter.gamma-mode", v); } #[doc(alias = "get_gamma_mode")] @@ -432,7 +432,7 @@ impl VideoConverterConfig { } pub fn set_primaries_mode(&mut self, v: crate::VideoPrimariesMode) { - self.0.set("GstVideoConverter.primaries-mode", &v); + self.0.set("GstVideoConverter.primaries-mode", v); } #[doc(alias = "get_primaries_mode")] @@ -444,7 +444,7 @@ impl VideoConverterConfig { } pub fn set_threads(&mut self, v: u32) { - self.0.set("GstVideoConverter.threads", &v); + self.0.set("GstVideoConverter.threads", v); } #[doc(alias = "get_threads")] diff --git a/gstreamer/src/caps.rs b/gstreamer/src/caps.rs index e2ed9e8af..6606d8c97 100644 --- a/gstreamer/src/caps.rs +++ b/gstreamer/src/caps.rs @@ -1049,7 +1049,7 @@ mod tests { ("bool", &true), ("string", &"bla"), ("fraction", &Fraction::new(1, 2)), - ("array", &Array::new(&[&1, &2])), + ("array", &Array::new([1, 2])), ], ); assert_eq!( @@ -1068,7 +1068,7 @@ mod tests { ("bool", &true), ("string", &"bla"), ("fraction", &Fraction::new(1, 2)), - ("array", &Array::new(&[&1, &2])), + ("array", &Array::new([1, 2])), ], ) .as_ref() @@ -1098,7 +1098,7 @@ mod tests { .field("bool", true) .field("string", "bla") .field("fraction", Fraction::new(1, 2)) - .field("array", Array::new(&[&1, &2])) + .field("array", Array::new([1, 2])) .build(); assert_eq!( caps.to_string(), @@ -1239,13 +1239,13 @@ mod tests { Structure::builder("audio/x-raw") .field( "struct", - Structure::builder("nested").field("badger", &true).build(), + Structure::builder("nested").field("badger", true).build(), ) .build(), ) .structure( Structure::builder("video/x-raw") - .field("width", &800u32) + .field("width", 800u32) .build(), ) .build(); @@ -1255,8 +1255,8 @@ mod tests { let caps = Caps::builder_full() .structure( Structure::builder("video/x-raw") - .field("array", &crate::Array::new(["a", "b", "c"])) - .field("list", &crate::List::new(["d", "e", "f"])) + .field("array", crate::Array::new(["a", "b", "c"])) + .field("list", crate::List::new(["d", "e", "f"])) .build(), ) .build(); diff --git a/gstreamer/src/caps_serde.rs b/gstreamer/src/caps_serde.rs index 1f3fb1c99..c39df77e3 100644 --- a/gstreamer/src/caps_serde.rs +++ b/gstreamer/src/caps_serde.rs @@ -237,7 +237,7 @@ mod tests { .field("bool", true) .field("string", "bla") .field("fraction", Fraction::new(1, 2)) - .field("array", Array::new(&[&1, &2])) + .field("array", Array::new([1, 2])) .build(); let pretty_config = ron::ser::PrettyConfig::new().new_line("".to_string()); @@ -267,7 +267,7 @@ mod tests { .field("bool", true) .field("string", "bla") .field("fraction", Fraction::new(1, 2)) - .field("array", Array::new(&[&1, &2])) + .field("array", Array::new([1, 2])) .features(&["foo:bar", "foo:baz"]) .build(); @@ -301,7 +301,7 @@ mod tests { .field("bool", true) .field("string", "bla") .field("fraction", Fraction::new(1, 2)) - .field("array", Array::new(&[&1, &2])) + .field("array", Array::new([1, 2])) .any_features() .build(); @@ -375,7 +375,7 @@ mod tests { .field("bool", true) .field("string", "bla") .field("fraction", Fraction::new(1, 2)) - .field("array", Array::new(&[&1, &2])) + .field("array", Array::new([1, 2])) .build() .as_ref() ); @@ -406,7 +406,7 @@ mod tests { .field("bool", true) .field("string", str_none) .field("fraction", Fraction::new(1, 2)) - .field("array", Array::new(&[&1, &2])) + .field("array", Array::new([1, 2])) .build() .as_ref() ); @@ -438,7 +438,7 @@ mod tests { .field("bool", true) .field("string", "bla") .field("fraction", Fraction::new(1, 2)) - .field("array", Array::new(&[&1, &2])) + .field("array", Array::new([1, 2])) .build() .as_ref() ); @@ -465,7 +465,7 @@ mod tests { .field("bool", true) .field("string", "bla") .field("fraction", Fraction::new(1, 2)) - .field("array", Array::new(&[&1, &2])) + .field("array", Array::new([1, 2])) .build(); let caps_ser = ron::ser::to_string(&caps).unwrap(); let caps_de: Caps = ron::de::from_str(caps_ser.as_str()).unwrap(); @@ -476,7 +476,7 @@ mod tests { .field("bool", true) .field("string", "bla") .field("fraction", Fraction::new(1, 2)) - .field("array", Array::new(&[&1, &2])) + .field("array", Array::new([1, 2])) .features(&["foo:bar", "foo:baz"]) .build(); let caps_ser = ron::ser::to_string(&caps).unwrap(); @@ -488,7 +488,7 @@ mod tests { .field("bool", true) .field("string", "bla") .field("fraction", Fraction::new(1, 2)) - .field("array", Array::new(&[&1, &2])) + .field("array", Array::new([1, 2])) .any_features() .build(); let caps_ser = ron::ser::to_string(&caps).unwrap(); diff --git a/gstreamer/src/event.rs b/gstreamer/src/event.rs index 1cf531c58..358a21fd6 100644 --- a/gstreamer/src/event.rs +++ b/gstreamer/src/event.rs @@ -2403,7 +2403,7 @@ mod tests { { let flush_start_evt = flush_start_evt.get_mut().unwrap(); let structure = flush_start_evt.structure_mut(); - structure.set("test", &42u32); + structure.set("test", 42u32); } let structure = flush_start_evt.structure().unwrap(); diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index 4907e4549..47951bce6 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -1454,7 +1454,7 @@ where } }; - let copied_size = new_buffer.copy_to_slice(0, &mut *map); + let copied_size = new_buffer.copy_to_slice(0, &mut map); drop(map); if let Err(copied_size) = copied_size { diff --git a/gstreamer/src/query.rs b/gstreamer/src/query.rs index 635ec85c4..05957ab3b 100644 --- a/gstreamer/src/query.rs +++ b/gstreamer/src/query.rs @@ -1680,7 +1680,7 @@ mod tests { let pos = p.result(); assert_eq!(pos.try_into(), Ok(ClockTime::NONE)); - p.structure_mut().set("check_mut", &true); + p.structure_mut().set("check_mut", true); // deref assert!(!p.is_serialized()); diff --git a/gstreamer/src/structure.rs b/gstreamer/src/structure.rs index 447a9a47b..8d5baa2bb 100644 --- a/gstreamer/src/structure.rs +++ b/gstreamer/src/structure.rs @@ -1170,14 +1170,14 @@ mod tests { let s = Structure::builder("test") .field("f1", "abc") - .field("f2", &String::from("bcd")) + .field("f2", String::from("bcd")) .field("f3", 123i32) .field( "f4", - Structure::builder("nested").field("badger", &true).build(), + Structure::builder("nested").field("badger", true).build(), ) - .field("f5", &crate::Array::new(["a", "b", "c"])) - .field("f6", &crate::List::new(["d", "e", "f"])) + .field("f5", crate::Array::new(["a", "b", "c"])) + .field("f6", crate::List::new(["d", "e", "f"])) .build(); assert_eq!(format!("{:?}", s), "Structure(test { f1: (gchararray) \"abc\", f2: (gchararray) \"bcd\", f3: (gint) 123, f4: Structure(nested { badger: (gboolean) TRUE }), f5: Array([(gchararray) \"a\", (gchararray) \"b\", (gchararray) \"c\"]), f6: List([(gchararray) \"d\", (gchararray) \"e\", (gchararray) \"f\"]) })"); diff --git a/gstreamer/src/structure_serde.rs b/gstreamer/src/structure_serde.rs index 89a7b732a..18cf1e937 100644 --- a/gstreamer/src/structure_serde.rs +++ b/gstreamer/src/structure_serde.rs @@ -185,7 +185,7 @@ mod tests { "date_time", DateTime::new(2f32, 2019, 8, 19, 13, 34, 42f64).unwrap(), ) - .field("array", Array::new(&[&1, &2])) + .field("array", Array::new([1, 2])) .build(); let pretty_config = ron::ser::PrettyConfig::new().new_line("".to_string()); @@ -241,7 +241,7 @@ mod tests { DateTime::new(2f32, 2019, 8, 19, 13, 34, 42f64).unwrap() ) .field("fraction", Fraction::new(1, 2)) - .field("array", Array::new(&[&1, &2])) + .field("array", Array::new([1, 2])) .build() .as_ref() ); @@ -261,7 +261,7 @@ mod tests { "date_time", DateTime::new(2f32, 2019, 8, 19, 13, 34, 42f64).unwrap(), ) - .field("array", Array::new(&[&1, &2])) + .field("array", Array::new([1, 2])) .build(); let s_ser = ron::ser::to_string(&s).unwrap(); let s_de: Structure = ron::de::from_str(s_ser.as_str()).unwrap(); diff --git a/gstreamer/src/tags.rs b/gstreamer/src/tags.rs index cff9041ba..611d28f01 100644 --- a/gstreamer/src/tags.rs +++ b/gstreamer/src/tags.rs @@ -1192,11 +1192,7 @@ mod tests { .add_generic(&TAG_TITLE, "second title", TagMergeMode::Append) .is_ok()); assert!(tags - .add_generic( - &TAG_DURATION, - &(ClockTime::SECOND * 120), - TagMergeMode::Append - ) + .add_generic(&TAG_DURATION, ClockTime::SECOND * 120, TagMergeMode::Append) .is_ok()); assert!(tags .add_generic(&TAG_TITLE, "third title", TagMergeMode::Append) diff --git a/gstreamer/src/typefind.rs b/gstreamer/src/typefind.rs index 2c5ffaa53..60560bb87 100644 --- a/gstreamer/src/typefind.rs +++ b/gstreamer/src/typefind.rs @@ -308,7 +308,7 @@ mod tests { let data = b"abcdefgh"; let data = &data[..]; - let (probability, caps) = SliceTypeFind::type_find(&data); + let (probability, caps) = SliceTypeFind::type_find(data); assert_eq!(caps, Some(Caps::builder("test/test").build())); assert_eq!(probability, TypeFindProbability::Likely); diff --git a/gstreamer/src/value_serde.rs b/gstreamer/src/value_serde.rs index bcf325775..c4f17a83b 100644 --- a/gstreamer/src/value_serde.rs +++ b/gstreamer/src/value_serde.rs @@ -374,7 +374,7 @@ mod tests { let value_13 = Fraction::new(1, 3); let value_12 = Fraction::new(1, 2); - let array = Array::new(&[&value_13, &value_12]); + let array = Array::new([value_13, value_12]); let res = ron::ser::to_string_pretty(&array, pretty_config.clone()); assert_eq!( @@ -394,7 +394,7 @@ mod tests { // List let value_12 = Fraction::new(1, 2); - let list = List::new(&[&value_12]); + let list = List::new([value_12]); let res = ron::ser::to_string_pretty(&list, pretty_config); assert_eq!( @@ -636,7 +636,7 @@ mod tests { let value_13 = Fraction::new(1, 3); let value_12 = Fraction::new(1, 2); - let array = Array::new(&[&value_13, &value_12]); + let array = Array::new([value_13, value_12]); let array_ser = ron::ser::to_string(&array).unwrap(); let array_de: Array = ron::de::from_str(array_ser.as_str()).unwrap(); @@ -657,7 +657,7 @@ mod tests { // List let value_12 = Fraction::new(1, 2); - let list = List::new(&[&value_12]); + let list = List::new([value_12]); let list_ser = ron::ser::to_string(&list).unwrap(); let list_de: List = ron::de::from_str(list_ser.as_str()).unwrap();