diff options
-rw-r--r-- | src/lib.rs | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -17,7 +17,8 @@ pub struct Client { impl Client { pub fn channel_stream(&self) -> String { - let mut res = self.inner.get(&self.channel_stream_url()) + let url = self.url(ZOTAPI_CHANNEL_STREAM_PATH); + let mut res = self.inner.get(&url) .header(Accept(vec![qitem(mime::APPLICATION_JSON)])) .basic_auth(self.user.clone(), Some(self.pw.clone())) .send() @@ -28,8 +29,8 @@ impl Client { body } - fn channel_stream_url(&self) -> String { - self.base_url.clone() + ZOTAPI_CHANNEL_STREAM_PATH + fn url(&self, path: &str) -> String { + self.base_url.clone() + path } } |