From f89e840d27fbd71d1faecc590f2fb86417d47ad5 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Thu, 29 Apr 2021 11:47:24 +0200 Subject: [PATCH] Remove redundant prelude imports When importing the prelude of a crate like `gst` the `glib` prelude is provided too. Shedding these imports saves quite a few lines and adheres to keeping it simple; we're not reexporting base/parent preludes for no reason :) --- examples/src/bin/encodebin.rs | 1 - examples/src/bin/glfilter.rs | 2 -- examples/src/bin/gtkvideooverlay.rs | 2 -- examples/src/bin/rtsp-server-subclass.rs | 4 ---- examples/src/bin/subclass.rs | 2 -- examples/src/glupload.rs | 1 - gstreamer-audio/src/subclass/audio_decoder.rs | 1 - gstreamer-audio/src/subclass/audio_encoder.rs | 1 - gstreamer-audio/src/subclass/audio_sink.rs | 1 - gstreamer-audio/src/subclass/audio_src.rs | 1 - gstreamer-base/src/subclass/aggregator.rs | 1 - gstreamer-base/src/subclass/aggregator_pad.rs | 1 - gstreamer-base/src/subclass/base_parse.rs | 1 - gstreamer-base/src/subclass/base_sink.rs | 1 - gstreamer-base/src/subclass/base_src.rs | 1 - gstreamer-base/src/subclass/base_transform.rs | 1 - gstreamer-check/src/harness.rs | 1 - gstreamer-gl/src/subclass/gl_base_filter.rs | 1 - gstreamer-gl/src/subclass/gl_filter.rs | 1 - gstreamer-video/src/subclass/video_decoder.rs | 2 -- gstreamer-video/src/subclass/video_encoder.rs | 2 -- gstreamer-video/src/subclass/video_sink.rs | 2 -- gstreamer-video/src/video_time_code.rs | 1 - gstreamer/src/element.rs | 1 - gstreamer/src/message.rs | 1 - tutorials/src/bin/basic-tutorial-5.rs | 1 - 26 files changed, 35 deletions(-) diff --git a/examples/src/bin/encodebin.rs b/examples/src/bin/encodebin.rs index 0864823d4..93a64057f 100644 --- a/examples/src/bin/encodebin.rs +++ b/examples/src/bin/encodebin.rs @@ -14,7 +14,6 @@ use gst::element_error; use gst::element_warning; -use gst::prelude::*; use gst_pbutils::prelude::*; diff --git a/examples/src/bin/glfilter.rs b/examples/src/bin/glfilter.rs index 34c6a28e6..0fe7f377e 100644 --- a/examples/src/bin/glfilter.rs +++ b/examples/src/bin/glfilter.rs @@ -27,8 +27,6 @@ void main () { mod mirror { use super::{gl, FRAGMENT_SHADER}; - use gst::subclass::prelude::*; - use gst_base::subclass::prelude::*; use gst_base::subclass::BaseTransformMode; use gst_gl::prelude::*; use gst_gl::subclass::prelude::*; diff --git a/examples/src/bin/gtkvideooverlay.rs b/examples/src/bin/gtkvideooverlay.rs index 340a6c8c2..b7eaf0989 100644 --- a/examples/src/bin/gtkvideooverlay.rs +++ b/examples/src/bin/gtkvideooverlay.rs @@ -17,8 +17,6 @@ // {videotestsrc} - {xvimagesink(on linux)} // {videotestsrc} - {glimagesink(on mac)} -use gst::prelude::*; - use gst_video::prelude::*; use gio::prelude::*; diff --git a/examples/src/bin/rtsp-server-subclass.rs b/examples/src/bin/rtsp-server-subclass.rs index 32de9e95f..35e29f396 100644 --- a/examples/src/bin/rtsp-server-subclass.rs +++ b/examples/src/bin/rtsp-server-subclass.rs @@ -78,7 +78,6 @@ fn main_loop() -> Result<(), Error> { mod media_factory { use super::*; - use glib::subclass::prelude::*; use gst_rtsp_server::subclass::prelude::*; // In the imp submodule we include the actual implementation @@ -160,7 +159,6 @@ mod media_factory { // Our custom media subclass that adds a custom attribute to the SDP returned by DESCRIBE mod media { - use glib::subclass::prelude::*; use gst_rtsp_server::subclass::prelude::*; // In the imp submodule we include the actual implementation @@ -217,7 +215,6 @@ mod media { mod server { use super::*; - use glib::subclass::prelude::*; use gst_rtsp_server::subclass::prelude::*; // In the imp submodule we include the actual implementation @@ -282,7 +279,6 @@ mod server { // Our custom RTSP client subclass. mod client { - use glib::subclass::prelude::*; use gst_rtsp_server::subclass::prelude::*; // In the imp submodule we include the actual implementation diff --git a/examples/src/bin/subclass.rs b/examples/src/bin/subclass.rs index 27c64183d..a539f0d79 100644 --- a/examples/src/bin/subclass.rs +++ b/examples/src/bin/subclass.rs @@ -19,8 +19,6 @@ mod examples_common; mod fir_filter { use super::*; - use glib::subclass::prelude::*; - use gst::subclass::prelude::*; use gst_base::subclass::prelude::*; use byte_slice_cast::*; diff --git a/examples/src/glupload.rs b/examples/src/glupload.rs index 170ee5100..a940cf06d 100644 --- a/examples/src/glupload.rs +++ b/examples/src/glupload.rs @@ -5,7 +5,6 @@ // {videotestsrc} - { glsinkbin } use gst::element_error; -use gst::prelude::*; use gst_gl::prelude::*; diff --git a/gstreamer-audio/src/subclass/audio_decoder.rs b/gstreamer-audio/src/subclass/audio_decoder.rs index af067ceee..d2484e25c 100644 --- a/gstreamer-audio/src/subclass/audio_decoder.rs +++ b/gstreamer-audio/src/subclass/audio_decoder.rs @@ -1,6 +1,5 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use glib::subclass::prelude::*; use glib::translate::*; use gst::subclass::prelude::*; diff --git a/gstreamer-audio/src/subclass/audio_encoder.rs b/gstreamer-audio/src/subclass/audio_encoder.rs index 155f530b0..09bf9e83a 100644 --- a/gstreamer-audio/src/subclass/audio_encoder.rs +++ b/gstreamer-audio/src/subclass/audio_encoder.rs @@ -1,6 +1,5 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use glib::subclass::prelude::*; use glib::translate::*; use gst::subclass::prelude::*; diff --git a/gstreamer-audio/src/subclass/audio_sink.rs b/gstreamer-audio/src/subclass/audio_sink.rs index 44d9d0ec5..c5bc6c762 100644 --- a/gstreamer-audio/src/subclass/audio_sink.rs +++ b/gstreamer-audio/src/subclass/audio_sink.rs @@ -1,7 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. use glib::prelude::*; -use glib::subclass::prelude::*; use glib::translate::*; use gst::LoggableError; diff --git a/gstreamer-audio/src/subclass/audio_src.rs b/gstreamer-audio/src/subclass/audio_src.rs index 9abb13dfa..ab15b6cd6 100644 --- a/gstreamer-audio/src/subclass/audio_src.rs +++ b/gstreamer-audio/src/subclass/audio_src.rs @@ -3,7 +3,6 @@ use std::mem; use glib::prelude::*; -use glib::subclass::prelude::*; use glib::translate::*; use gst::LoggableError; diff --git a/gstreamer-base/src/subclass/aggregator.rs b/gstreamer-base/src/subclass/aggregator.rs index e4a25bf70..a2c92412f 100644 --- a/gstreamer-base/src/subclass/aggregator.rs +++ b/gstreamer-base/src/subclass/aggregator.rs @@ -1,7 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. use glib::prelude::*; -use glib::subclass::prelude::*; use glib::translate::*; use gst::subclass::prelude::*; diff --git a/gstreamer-base/src/subclass/aggregator_pad.rs b/gstreamer-base/src/subclass/aggregator_pad.rs index c963a1206..87b804415 100644 --- a/gstreamer-base/src/subclass/aggregator_pad.rs +++ b/gstreamer-base/src/subclass/aggregator_pad.rs @@ -1,7 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. use glib::prelude::*; -use glib::subclass::prelude::*; use glib::translate::*; use gst::subclass::prelude::*; diff --git a/gstreamer-base/src/subclass/base_parse.rs b/gstreamer-base/src/subclass/base_parse.rs index b09bbac3e..a6a0f9a1a 100644 --- a/gstreamer-base/src/subclass/base_parse.rs +++ b/gstreamer-base/src/subclass/base_parse.rs @@ -5,7 +5,6 @@ use std::mem; use crate::prelude::*; -use glib::subclass::prelude::*; use glib::translate::*; use gst::subclass::prelude::*; diff --git a/gstreamer-base/src/subclass/base_sink.rs b/gstreamer-base/src/subclass/base_sink.rs index 7cb9a4ca4..8486ded3b 100644 --- a/gstreamer-base/src/subclass/base_sink.rs +++ b/gstreamer-base/src/subclass/base_sink.rs @@ -1,7 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. use glib::prelude::*; -use glib::subclass::prelude::*; use glib::translate::*; use gst::subclass::prelude::*; diff --git a/gstreamer-base/src/subclass/base_src.rs b/gstreamer-base/src/subclass/base_src.rs index 87c826613..0273d331d 100644 --- a/gstreamer-base/src/subclass/base_src.rs +++ b/gstreamer-base/src/subclass/base_src.rs @@ -1,7 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. use glib::prelude::*; -use glib::subclass::prelude::*; use glib::translate::*; use gst::subclass::prelude::*; diff --git a/gstreamer-base/src/subclass/base_transform.rs b/gstreamer-base/src/subclass/base_transform.rs index be3f9f8ee..b79ed8f52 100644 --- a/gstreamer-base/src/subclass/base_transform.rs +++ b/gstreamer-base/src/subclass/base_transform.rs @@ -2,7 +2,6 @@ use crate::prelude::*; -use glib::subclass::prelude::*; use glib::translate::*; use gst::gst_warning; diff --git a/gstreamer-check/src/harness.rs b/gstreamer-check/src/harness.rs index 7da5b6c58..39eee6581 100644 --- a/gstreamer-check/src/harness.rs +++ b/gstreamer-check/src/harness.rs @@ -1,7 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::TestClock; -use glib::prelude::*; use glib::translate::*; use gst::prelude::*; use std::marker::PhantomData; diff --git a/gstreamer-gl/src/subclass/gl_base_filter.rs b/gstreamer-gl/src/subclass/gl_base_filter.rs index 392912ee7..23c24cda1 100644 --- a/gstreamer-gl/src/subclass/gl_base_filter.rs +++ b/gstreamer-gl/src/subclass/gl_base_filter.rs @@ -5,7 +5,6 @@ use crate::prelude::*; use glib::translate::*; -use gst::subclass::prelude::*; use gst::{result_from_gboolean, Caps, LoggableError, CAT_RUST}; use gst_base::subclass::prelude::*; diff --git a/gstreamer-gl/src/subclass/gl_filter.rs b/gstreamer-gl/src/subclass/gl_filter.rs index d9547e114..cdefefa43 100644 --- a/gstreamer-gl/src/subclass/gl_filter.rs +++ b/gstreamer-gl/src/subclass/gl_filter.rs @@ -6,7 +6,6 @@ use crate::prelude::*; use glib::translate::*; -use gst::subclass::prelude::*; use gst::{result_from_gboolean, Buffer, Caps, LoggableError, PadDirection, CAT_RUST}; use crate::GLBaseFilter; diff --git a/gstreamer-video/src/subclass/video_decoder.rs b/gstreamer-video/src/subclass/video_decoder.rs index 6dde34b7d..311b87c4e 100644 --- a/gstreamer-video/src/subclass/video_decoder.rs +++ b/gstreamer-video/src/subclass/video_decoder.rs @@ -1,7 +1,5 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use glib::prelude::*; -use glib::subclass::prelude::*; use glib::translate::*; use gst::subclass::prelude::*; diff --git a/gstreamer-video/src/subclass/video_encoder.rs b/gstreamer-video/src/subclass/video_encoder.rs index b886b577e..71f5655c8 100644 --- a/gstreamer-video/src/subclass/video_encoder.rs +++ b/gstreamer-video/src/subclass/video_encoder.rs @@ -1,7 +1,5 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use glib::prelude::*; -use glib::subclass::prelude::*; use glib::translate::*; use gst::subclass::prelude::*; diff --git a/gstreamer-video/src/subclass/video_sink.rs b/gstreamer-video/src/subclass/video_sink.rs index b68ce9075..160081e5b 100644 --- a/gstreamer-video/src/subclass/video_sink.rs +++ b/gstreamer-video/src/subclass/video_sink.rs @@ -1,10 +1,8 @@ // Take a look at the license at the top of the repository in the LICENSE file. use glib::prelude::*; -use glib::subclass::prelude::*; use glib::translate::*; -use gst::subclass::prelude::*; use gst_base::subclass::prelude::*; use crate::VideoSink; diff --git a/gstreamer-video/src/video_time_code.rs b/gstreamer-video/src/video_time_code.rs index f1dcef555..36050b7c4 100644 --- a/gstreamer-video/src/video_time_code.rs +++ b/gstreamer-video/src/video_time_code.rs @@ -1,6 +1,5 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use glib::prelude::*; use glib::translate::*; use gst::prelude::*; use std::cmp; diff --git a/gstreamer/src/element.rs b/gstreamer/src/element.rs index ff91f0462..a345cdb90 100644 --- a/gstreamer/src/element.rs +++ b/gstreamer/src/element.rs @@ -23,7 +23,6 @@ use crate::StateChangeError; use crate::StateChangeReturn; use crate::StateChangeSuccess; -use glib::prelude::*; use glib::translate::*; use std::ffi::CStr; diff --git a/gstreamer/src/message.rs b/gstreamer/src/message.rs index b82138158..b709bd565 100644 --- a/gstreamer/src/message.rs +++ b/gstreamer/src/message.rs @@ -16,7 +16,6 @@ use std::num::NonZeroU32; use std::ops::Deref; use std::ptr; -use glib::prelude::*; use glib::translate::{ from_glib, from_glib_full, from_glib_none, mut_override, IntoGlib, ToGlibPtr, }; diff --git a/tutorials/src/bin/basic-tutorial-5.rs b/tutorials/src/bin/basic-tutorial-5.rs index b29b810a0..593b65346 100644 --- a/tutorials/src/bin/basic-tutorial-5.rs +++ b/tutorials/src/bin/basic-tutorial-5.rs @@ -6,7 +6,6 @@ mod tutorial5 { use gdk::prelude::*; use gtk::prelude::*; - use gst::prelude::*; use gst_video::prelude::*; use std::ops;