Skip to content

Commit

Permalink
sound: Fix some clippy lints
Browse files Browse the repository at this point in the history
Fix cases where Self can be used in a type method, and remove enum
variant glob imports.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
  • Loading branch information
epilys committed Nov 19, 2023
1 parent b8c7f65 commit 4a119f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions staging/vhost-device-sound/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl TryFrom<SoundArgs> for SoundConfig {
fn try_from(cmd_args: SoundArgs) -> Result<Self> {
let socket = cmd_args.socket.trim().to_string();

Ok(SoundConfig::new(socket, false, cmd_args.backend))
Ok(Self::new(socket, false, cmd_args.backend))
}
}

Expand All @@ -46,7 +46,7 @@ mod tests {

impl SoundArgs {
fn from_args(socket: &str) -> Self {
SoundArgs {
Self {
socket: socket.to_string(),
backend: BackendType::default(),
}
Expand Down
2 changes: 1 addition & 1 deletion staging/vhost-device-sound/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 4a119f6

Please sign in to comment.