added territory selections

This commit is contained in:
TotallyNot 2023-02-21 01:34:46 +01:00
parent 7e97b736ad
commit 3757d1778f
10 changed files with 177 additions and 177 deletions

View file

@ -165,7 +165,7 @@ impl<A> ApiRequest<A>
where
A: ApiCategoryResponse,
{
pub fn url(&self, key: &str, id: Option<i64>) -> String {
pub fn url(&self, key: &str, id: Option<&str>) -> String {
let mut url = format!("https://api.torn.com/{}/", A::Selection::category());
if let Some(id) = id {
@ -195,7 +195,7 @@ where
A: ApiCategoryResponse,
{
request: ApiRequest<A>,
id: Option<i64>,
id: Option<String>,
}
impl<A> Default for ApiRequestBuilder<A>
@ -243,9 +243,9 @@ where
#[must_use]
pub fn id<I>(mut self, id: I) -> Self
where
I: num_traits::AsPrimitive<i64>,
I: ToString,
{
self.id = Some(id.as_());
self.id = Some(id.to_string());
self
}
}