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")