INNER CODE UNIT · Rust
from
aome510/spotify-player · spotify_player/src/cli/mod.rs:144
fn from(value: ContextType) -> Self {
match value {
ContextType::Playlist => Self::Playlist,
ContextType::Album => Self::Album,
ContextType::Artist => Self::Artist,
}
}
}
impl ItemId {
pub fn uri(&self) -> String {
match self {
ItemId::Playlist(id) => id.uri(),
ItemId::Artist(id) => id.uri(),
ItemId::Album(id) => id.uri(),
ItemId::Track(id) => id.uri(),
}
}