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

View file

@ -59,13 +59,15 @@ struct CurrentTemplate {
async fn get_current(_req: tide::Request<()>) -> tide::Result {
let mut mpd = mpd::connect()?;
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 {
let name = song.title.unwrap_or(song.file.clone()).to_string();
template.name = Some(name);
}
Ok(template.into())