Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3fe2732

Browse files
committed
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.
1 parent 8375dd0 commit 3fe2732

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

etc/api/type-cli.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ cargo:
3131
- serde = ">= 0.3.0"
3232
- serde_macros = "*"
3333
- clap = "*"
34+
- json-tools = "*"

src/mako/Cargo.toml.mako

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ name = "${util.program_name()}"
2323
% endif
2424
2525
[dependencies]
26-
hyper = "*"
26+
hyper = ">= 0.4.0"
2727
mime = "*"
2828
yup-oauth2 = "*"
2929
% for dep in cargo.get('dependencies', list()):

src/rust/api/cmn.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pub trait Delegate {
136136
/// [exponential backoff algorithm](http://en.wikipedia.org/wiki/Exponential_backoff).
137137
///
138138
/// Return retry information.
139-
fn http_error(&mut self, &hyper::HttpError) -> Retry {
139+
fn http_error(&mut self, &hyper::Error) -> Retry {
140140
Retry::Abort
141141
}
142142

@@ -248,7 +248,7 @@ impl Delegate for DefaultDelegate {}
248248
#[derive(Debug)]
249249
pub enum Error {
250250
/// The http connection failed
251-
HttpError(hyper::HttpError),
251+
HttpError(hyper::Error),
252252

253253
/// An attempt was made to upload a resource with size stored in field `.0`
254254
/// even though the maximum upload size is what is stored in field `.1`.
@@ -587,7 +587,7 @@ pub struct ResumableUploadHelper<'a, A: 'a> {
587587
impl<'a, A> ResumableUploadHelper<'a, A>
588588
where A: oauth2::GetToken {
589589

590-
fn query_transfer_status(&mut self) -> std::result::Result<u64, hyper::HttpResult<hyper::client::Response>> {
590+
fn query_transfer_status(&mut self) -> std::result::Result<u64, hyper::Result<hyper::client::Response>> {
591591
loop {
592592
match self.client.post(self.url)
593593
.header(UserAgent(self.user_agent.to_string()))
@@ -623,7 +623,7 @@ impl<'a, A> ResumableUploadHelper<'a, A>
623623
/// returns None if operation was cancelled by delegate, or the HttpResult.
624624
/// It can be that we return the result just because we didn't understand the status code -
625625
/// caller should check for status himself before assuming it's OK to use
626-
pub fn upload(&mut self) -> Option<hyper::HttpResult<hyper::client::Response>> {
626+
pub fn upload(&mut self) -> Option<hyper::Result<hyper::client::Response>> {
627627
let mut start = match self.start_at {
628628
Some(s) => s,
629629
None => match self.query_transfer_status() {

0 commit comments

Comments
 (0)