diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2018-08-07 23:20:07 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2018-08-07 23:20:07 +0200 |
commit | 2a05b5a40a822f52ffcd1377aad9285d15da4d9f (patch) | |
tree | fd2faa169affb29a1a76c4e0780b9ad66b6a7e24 | |
parent | 540f8e4dd046ba37bd692fe96b15df4fe5ddec4c (diff) | |
download | rust-zotapi-2a05b5a40a822f52ffcd1377aad9285d15da4d9f.tar.gz rust-zotapi-2a05b5a40a822f52ffcd1377aad9285d15da4d9f.tar.bz2 rust-zotapi-2a05b5a40a822f52ffcd1377aad9285d15da4d9f.zip |
Refactor generating target url
-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 } } |