From 3fe2732a01371ededca2c35fe7499a4bbe63c318 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 8 May 2015 11:52:28 +0200 Subject: [PATCH] fix(compat): upgrade to hyper v0.4.0 It was basically just a find-and-replace to adapt to the changed names of Error and Result types. --- etc/api/type-cli.yaml | 1 + src/mako/Cargo.toml.mako | 2 +- src/rust/api/cmn.rs | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/etc/api/type-cli.yaml b/etc/api/type-cli.yaml index 82f29a1772..783c3e74cf 100644 --- a/etc/api/type-cli.yaml +++ b/etc/api/type-cli.yaml @@ -31,3 +31,4 @@ cargo: - serde = ">= 0.3.0" - serde_macros = "*" - clap = "*" + - json-tools = "*" diff --git a/src/mako/Cargo.toml.mako b/src/mako/Cargo.toml.mako index 4c98f29a29..9f48de8a47 100644 --- a/src/mako/Cargo.toml.mako +++ b/src/mako/Cargo.toml.mako @@ -23,7 +23,7 @@ name = "${util.program_name()}" % endif [dependencies] -hyper = "*" +hyper = ">= 0.4.0" mime = "*" yup-oauth2 = "*" % for dep in cargo.get('dependencies', list()): diff --git a/src/rust/api/cmn.rs b/src/rust/api/cmn.rs index 44e55348f2..ad141c7872 100644 --- a/src/rust/api/cmn.rs +++ b/src/rust/api/cmn.rs @@ -136,7 +136,7 @@ pub trait Delegate { /// [exponential backoff algorithm](http://en.wikipedia.org/wiki/Exponential_backoff). /// /// Return retry information. - fn http_error(&mut self, &hyper::HttpError) -> Retry { + fn http_error(&mut self, &hyper::Error) -> Retry { Retry::Abort } @@ -248,7 +248,7 @@ impl Delegate for DefaultDelegate {} #[derive(Debug)] pub enum Error { /// The http connection failed - HttpError(hyper::HttpError), + HttpError(hyper::Error), /// An attempt was made to upload a resource with size stored in field `.0` /// even though the maximum upload size is what is stored in field `.1`. @@ -587,7 +587,7 @@ pub struct ResumableUploadHelper<'a, A: 'a> { impl<'a, A> ResumableUploadHelper<'a, A> where A: oauth2::GetToken { - fn query_transfer_status(&mut self) -> std::result::Result> { + fn query_transfer_status(&mut self) -> std::result::Result> { loop { match self.client.post(self.url) .header(UserAgent(self.user_agent.to_string())) @@ -623,7 +623,7 @@ impl<'a, A> ResumableUploadHelper<'a, A> /// returns None if operation was cancelled by delegate, or the HttpResult. /// It can be that we return the result just because we didn't understand the status code - /// caller should check for status himself before assuming it's OK to use - pub fn upload(&mut self) -> Option> { + pub fn upload(&mut self) -> Option> { let mut start = match self.start_at { Some(s) => s, None => match self.query_transfer_status() {