diff options
Diffstat (limited to 'trakt-rs')
-rw-r--r-- | trakt-rs/Cargo.toml | 2 | ||||
-rw-r--r-- | trakt-rs/src/api/certifications.rs | 8 | ||||
-rw-r--r-- | trakt-rs/src/api/country.rs | 4 | ||||
-rw-r--r-- | trakt-rs/src/api/genres.rs | 6 | ||||
-rw-r--r-- | trakt-rs/src/smo.rs | 24 |
5 files changed, 22 insertions, 22 deletions
diff --git a/trakt-rs/Cargo.toml b/trakt-rs/Cargo.toml index fc28c5b..670cd1c 100644 --- a/trakt-rs/Cargo.toml +++ b/trakt-rs/Cargo.toml @@ -17,10 +17,10 @@ default = [] [dependencies] bitflags = "2.4" bytes = { workspace = true } +compact_str = { version = "0.7", features = ["serde"] } http = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -smol_str = { version = "0.2", features = ["serde"] } time = { workspace = true } trakt-core = { workspace = true } trakt-macros = { workspace = true } diff --git a/trakt-rs/src/api/certifications.rs b/trakt-rs/src/api/certifications.rs index 482ac1c..61dbddc 100644 --- a/trakt-rs/src/api/certifications.rs +++ b/trakt-rs/src/api/certifications.rs @@ -9,8 +9,8 @@ pub mod list { use std::collections::HashMap; + use compact_str::CompactString; use serde::Serialize; - use smol_str::SmolStr; use crate::smo::Country; @@ -35,8 +35,8 @@ pub mod list { #[derive(Debug, Clone, Eq, PartialEq, Hash, serde::Deserialize)] pub struct Certification { - pub name: SmolStr, - pub slug: SmolStr, - pub description: String, + pub name: CompactString, + pub slug: CompactString, + pub description: CompactString, } } diff --git a/trakt-rs/src/api/country.rs b/trakt-rs/src/api/country.rs index 477a9e5..313d052 100644 --- a/trakt-rs/src/api/country.rs +++ b/trakt-rs/src/api/country.rs @@ -7,8 +7,8 @@ pub mod list { //! //! <https://trakt.docs.apiary.io/#reference/countries/list/get-countries> + use compact_str::CompactString; use serde::{Deserialize, Serialize}; - use smol_str::SmolStr; use crate::smo::Country; @@ -33,7 +33,7 @@ pub mod list { #[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize)] pub struct ResponseItem { - pub name: SmolStr, + pub name: CompactString, pub code: Country, } } diff --git a/trakt-rs/src/api/genres.rs b/trakt-rs/src/api/genres.rs index 671fe02..d19bd32 100644 --- a/trakt-rs/src/api/genres.rs +++ b/trakt-rs/src/api/genres.rs @@ -7,8 +7,8 @@ pub mod list { //! //! <https://trakt.docs.apiary.io/#reference/genres/list/get-genres> + use compact_str::CompactString; use serde::{Deserialize, Serialize}; - use smol_str::SmolStr; #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, trakt_macros::Request)] #[trakt( @@ -31,7 +31,7 @@ pub mod list { #[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize)] pub struct ResponseItem { - pub name: SmolStr, - pub slug: SmolStr, + pub name: CompactString, + pub slug: CompactString, } } diff --git a/trakt-rs/src/smo.rs b/trakt-rs/src/smo.rs index fdc1809..4db49c5 100644 --- a/trakt-rs/src/smo.rs +++ b/trakt-rs/src/smo.rs @@ -3,8 +3,8 @@ mod de; mod ser; +use compact_str::CompactString; use serde::{Deserialize, Serialize}; -use smol_str::SmolStr; use time::{Date, OffsetDateTime}; use trakt_core::EmojiString; @@ -12,9 +12,9 @@ use trakt_core::EmojiString; #[serde(untagged)] pub enum Id { Trakt(u64), - Slug(SmolStr), + Slug(CompactString), Tvdb(u64), - Imdb(SmolStr), + Imdb(CompactString), Tmdb(u64), } @@ -37,25 +37,25 @@ pub struct Ids { #[serde(skip_serializing_if = "Option::is_none")] pub trakt: Option<u64>, #[serde(skip_serializing_if = "Option::is_none")] - pub slug: Option<SmolStr>, + pub slug: Option<CompactString>, #[serde(skip_serializing_if = "Option::is_none")] pub tvdb: Option<u64>, #[serde(skip_serializing_if = "Option::is_none")] - pub imdb: Option<SmolStr>, + pub imdb: Option<CompactString>, #[serde(skip_serializing_if = "Option::is_none")] pub tmdb: Option<u64>, } #[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)] pub struct Movie { - pub title: String, + pub title: CompactString, pub year: u16, pub ids: Ids, } #[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)] pub struct Show { - pub title: String, + pub title: CompactString, pub year: u16, pub ids: Ids, } @@ -70,21 +70,21 @@ pub struct Season { pub struct Episode { pub season: u16, pub number: u16, - pub title: String, + pub title: CompactString, pub ids: Ids, } #[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)] pub struct Person { - pub name: String, + pub name: CompactString, pub ids: Ids, } #[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)] pub struct User { - pub username: String, + pub username: CompactString, pub private: bool, - pub name: String, + pub name: CompactString, pub vip: bool, pub vip_ep: bool, pub ids: Ids, @@ -254,7 +254,7 @@ pub struct Distribution(pub [u32; 10]); #[derive(Debug, Clone, Eq, PartialEq, Hash, Deserialize)] pub struct Studio { - pub name: String, + pub name: CompactString, pub country: Country, pub ids: Ids, } |