remove redundant clones
This commit is contained in:
parent
e9af664888
commit
b472a155fc
7 changed files with 13 additions and 15 deletions
|
|
@ -685,7 +685,7 @@ impl cosmic::Application for Audio {
|
|||
if artists.len() > 15 {
|
||||
format!("{artists:15}...")
|
||||
} else {
|
||||
artists.to_string()
|
||||
artists
|
||||
}
|
||||
} else {
|
||||
String::new()
|
||||
|
|
|
|||
|
|
@ -27,12 +27,10 @@ pub struct PlayerStatus {
|
|||
impl PlayerStatus {
|
||||
async fn new(player: Player) -> Self {
|
||||
let metadata = player.metadata().await.unwrap();
|
||||
let title = metadata.title().map(|t| Cow::from(t.to_string()));
|
||||
let artists = metadata.artists().map(|a| {
|
||||
a.into_iter()
|
||||
.map(|a| Cow::from(a.to_string()))
|
||||
.collect::<Vec<_>>()
|
||||
});
|
||||
let title = metadata.title().map(|t| Cow::from(t));
|
||||
let artists = metadata
|
||||
.artists()
|
||||
.map(|a| a.into_iter().map(|a| Cow::from(a)).collect::<Vec<_>>());
|
||||
let icon = metadata
|
||||
.art_url()
|
||||
.and_then(|u| url::Url::parse(&u).ok())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue