From 46d2ddc99285afb1a92acef3ffa458b60ac16aee Mon Sep 17 00:00:00 2001 From: figsoda Date: Fri, 6 Nov 2020 08:55:45 -0500 Subject: [PATCH] replace if let with map_or --- src/main.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 01c2f8a..34a07b7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -353,11 +353,7 @@ async fn run() -> Result<()> { Command::ToggleOneshot => { mpd::command( &mut cl, - if status.single == None { - b"single 0\n" - } else { - b"single oneshot\n" - }, + status.single.map_or(b"single 0\n", |_| b"single oneshot\n"), ) .await .context("Failed to toggle oneshot")?;