From 5e5dab62af76a5302970e56126cd15bcd7219b98 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 10 Sep 2022 17:31:38 +0200 Subject: feat: make data structs clonable --- src/creator.rs | 2 +- src/playlist.rs | 10 +++++----- src/user.rs | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/creator.rs b/src/creator.rs index 81e3797..b8fde14 100644 --- a/src/creator.rs +++ b/src/creator.rs @@ -2,7 +2,7 @@ use serde::Deserialize; /// A user that created another object. -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] pub struct Creator { /// User ID. diff --git a/src/playlist.rs b/src/playlist.rs index b918282..b547eec 100644 --- a/src/playlist.rs +++ b/src/playlist.rs @@ -4,7 +4,7 @@ use serde::Deserialize; use crate::creator::Creator; /// A playlist. -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] pub struct Playlist { /// The playlist's Deezer id. @@ -70,7 +70,7 @@ pub struct Playlist } /// A track in a playlist. -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] pub struct PlaylistTrack { /// The track's Deezer id @@ -118,7 +118,7 @@ pub struct PlaylistTrack } /// The artist of a playlist track. -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] pub struct PlaylistTrackArtist { /// Artist id. @@ -132,7 +132,7 @@ pub struct PlaylistTrackArtist } /// The album of a playlist track. -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] pub struct PlaylistTrackAlbum { /// Album id. @@ -158,7 +158,7 @@ pub struct PlaylistTrackAlbum } /// Tracks in a playlist. -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] pub struct PlaylistTracks { /// Tracks. diff --git a/src/user.rs b/src/user.rs index ee22f5a..d4f57f9 100644 --- a/src/user.rs +++ b/src/user.rs @@ -13,7 +13,7 @@ use serde::Deserialize; use crate::creator::Creator; /// A Deezer user. -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] pub struct User { /// The user's Deezer ID @@ -87,7 +87,7 @@ pub struct User } /// A user's playlist. -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] pub struct UserPlaylist { /// The playlist's Deezer id @@ -146,7 +146,7 @@ pub struct UserPlaylist pub creator: Creator, } -#[derive(Debug, Deserialize)] +#[derive(Debug, Deserialize, Clone)] pub(crate) struct UserPlaylists { pub data: Vec, -- cgit v1.2.3-18-g5258