Add ID type for account
This commit is contained in:
		
							parent
							
								
									97ae0973c3
								
							
						
					
					
						commit
						547d994d13
					
				|  | @ -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<bool>, | ||||
| } | ||||
| 
 | ||||
| /// Wrapper type for a account ID string
 | ||||
| #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||||
| #[serde(transparent)] | ||||
| pub struct AccountId(String); | ||||
| 
 | ||||
| impl AsRef<str> 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 { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue