replace if let with map_or

This commit is contained in:
figsoda 2020-11-06 08:55:45 -05:00
parent bba751e034
commit 46d2ddc992

View file

@ -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")?;