From 2a05b5a40a822f52ffcd1377aad9285d15da4d9f Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Tue, 7 Aug 2018 23:20:07 +0200 Subject: Refactor generating target url --- src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c2d77ee..e02f38a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 } } -- cgit v1.2.3