Fix a few new clippy warnings

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1120>
This commit is contained in:
Sebastian Dröge 2023-03-07 10:46:34 +02:00 committed by GStreamer Marge Bot
parent 93503c0ca9
commit 3ef8a48ded
4 changed files with 8 additions and 25 deletions

View file

@ -84,18 +84,14 @@ impl Started {
}
}
#[derive(Default)]
enum State {
#[default]
Stopped,
Completed,
Started(Started),
}
impl Default for State {
fn default() -> State {
State::Stopped
}
}
struct Settings {
region: Region,
bucket: Option<String>,

View file

@ -30,8 +30,10 @@ const DEFAULT_RETRY_ATTEMPTS: u32 = 5;
const DEFAULT_REQUEST_TIMEOUT_MSEC: u64 = 15000;
const DEFAULT_RETRY_DURATION_MSEC: u64 = 60_000;
#[derive(Default)]
#[allow(clippy::large_enum_variant)]
enum StreamingState {
#[default]
Stopped,
Started {
url: GstS3Url,
@ -40,12 +42,6 @@ enum StreamingState {
},
}
impl Default for StreamingState {
fn default() -> StreamingState {
StreamingState::Stopped
}
}
struct Settings {
url: Option<GstS3Url>,
access_key: Option<String>,

View file

@ -123,8 +123,9 @@ struct ClientContextInner {
}
#[allow(clippy::large_enum_variant)]
#[derive(Debug)]
#[derive(Debug, Default)]
enum State {
#[default]
Stopped,
Started {
uri: Url,
@ -138,12 +139,6 @@ enum State {
},
}
impl Default for State {
fn default() -> Self {
State::Stopped
}
}
#[derive(Debug, Default)]
pub struct ReqwestHttpSrc {
client: Mutex<Option<ClientContext>>,

View file

@ -21,7 +21,9 @@ use gst_video::VideoFormat;
use once_cell::sync::Lazy;
use std::sync::Mutex;
#[derive(Default)]
enum DecoderState {
#[default]
Stopped,
Started {
output_info: Option<gst_video::VideoInfo>,
@ -30,12 +32,6 @@ enum DecoderState {
},
}
impl Default for DecoderState {
fn default() -> Self {
DecoderState::Stopped
}
}
#[derive(Default)]
pub struct Ffv1Dec {
state: Mutex<DecoderState>,