add type coercion helper to ListItem objects

This commit is contained in:
Henrik Friedrichsen
2019-06-09 23:57:47 +02:00
parent b59e9b38e6
commit 96a0e9f9d6
5 changed files with 18 additions and 0 deletions

View File

@@ -151,6 +151,10 @@ impl ListItem for Track {
current.map(|t| t.id == self.id).unwrap_or(false)
}
fn as_listitem(&self) -> Box<ListItem> {
Box::new(self.clone())
}
fn display_left(&self) -> String {
format!("{}", self)
}