From 4a119f6d31e2911a96fbebc1a1a4c552044fcc85 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Sun, 19 Nov 2023 14:20:25 +0200 Subject: [PATCH] sound: Fix some clippy lints Fix cases where Self can be used in a type method, and remove enum variant glob imports. Signed-off-by: Manos Pitsidianakis --- staging/vhost-device-sound/src/main.rs | 4 ++-- staging/vhost-device-sound/src/stream.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/staging/vhost-device-sound/src/main.rs b/staging/vhost-device-sound/src/main.rs index 52266268..d015e304 100644 --- a/staging/vhost-device-sound/src/main.rs +++ b/staging/vhost-device-sound/src/main.rs @@ -24,7 +24,7 @@ impl TryFrom for SoundConfig { fn try_from(cmd_args: SoundArgs) -> Result { let socket = cmd_args.socket.trim().to_string(); - Ok(SoundConfig::new(socket, false, cmd_args.backend)) + Ok(Self::new(socket, false, cmd_args.backend)) } } @@ -46,7 +46,7 @@ mod tests { impl SoundArgs { fn from_args(socket: &str) -> Self { - SoundArgs { + Self { socket: socket.to_string(), backend: BackendType::default(), } diff --git a/staging/vhost-device-sound/src/stream.rs b/staging/vhost-device-sound/src/stream.rs index 8dfb4ccf..4f619d60 100644 --- a/staging/vhost-device-sound/src/stream.rs +++ b/staging/vhost-device-sound/src/stream.rs @@ -146,7 +146,7 @@ impl PCMState { impl std::fmt::Display for PCMState { fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result { - use PCMState::*; + use PCMState::{Prepare, Release, SetParameters, Start, Stop}; match *self { SetParameters => { write!(fmt, "VIRTIO_SND_R_PCM_SET_PARAMS")