Format code

This commit is contained in:
Sijmen 2023-04-25 16:44:21 +02:00
parent e51c8991ac
commit 33ab0f36a3
Signed by: vijfhoek
GPG Key ID: DAF7821E067D9C48
1 changed files with 5 additions and 3 deletions

View File

@ -60,12 +60,14 @@ async fn get_current(_req: tide::Request<()>) -> tide::Result {
let mut mpd = mpd::connect()?; let mut mpd = mpd::connect()?;
let song = mpd.currentsong()?; let song = mpd.currentsong()?;
let mut template = CurrentTemplate { song: song.clone(), name: None }; let mut template = CurrentTemplate {
song: song.clone(),
name: None,
};
if let Some(song) = song { if let Some(song) = song {
let name = song.title.unwrap_or(song.file.clone()).to_string(); let name = song.title.unwrap_or(song.file.clone()).to_string();
template.name = Some(name); template.name = Some(name);
} }
Ok(template.into()) Ok(template.into())