From 01704d7169c07c9f3992ba36515464bf30cdff90 Mon Sep 17 00:00:00 2001 From: Paul Woolcock Date: Sun, 5 Aug 2018 21:10:09 -0400 Subject: [PATCH 1/2] fix bug introduced in the last change --- src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 466e93f..e30e267 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -601,11 +601,11 @@ impl Mastodon { pub fn statuses<'a, S>(&self, id: &str, request: S) -> Result> where S: Into>> { - let url = if let Some(request) = request.into() { - request.to_querystring() - } else { - format!("{}/api/v1/accounts/{}/statuses", self.base, id) - }; + let mut url = format!("{}/api/v1/accounts/{}/statuses", self.base, id); + + if let Some(request) = request.into() { + url = format!("{}/{}", url, request.to_querystring()); + } let response = self.client.get(&url) .headers(self.headers.clone()) From a647d47b57639a843aee1cad7d0a04dd0e736b91 Mon Sep 17 00:00:00 2001 From: Paul Woolcock Date: Sun, 5 Aug 2018 21:16:15 -0400 Subject: [PATCH 2/2] remove unnecessary slash --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index e30e267..ad130ef 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -604,7 +604,7 @@ impl Mastodon { let mut url = format!("{}/api/v1/accounts/{}/statuses", self.base, id); if let Some(request) = request.into() { - url = format!("{}/{}", url, request.to_querystring()); + url = format!("{}{}", url, request.to_querystring()); } let response = self.client.get(&url)