diff --git a/entities/src/account.rs b/entities/src/account.rs index 2afd9b3..f8d0d8c 100644 --- a/entities/src/account.rs +++ b/entities/src/account.rs @@ -30,7 +30,7 @@ pub struct Account { /// URL to the header static image (gif). pub header_static: String, /// The ID of the account. - pub id: String, + pub id: AccountId, /// Boolean for when the account cannot be followed without waiting for /// approval first. pub locked: bool, @@ -54,6 +54,17 @@ pub struct Account { pub bot: Option, } +/// Wrapper type for a account ID string +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +#[serde(transparent)] +pub struct AccountId(String); + +impl AsRef for AccountId { + fn as_ref(&self) -> &str { + &self.0 + } +} + /// A single name: value pair from a user's profile #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Default)] pub struct MetadataField {