Skip to content

Commit 191e822

Browse files
committed
fix(hyper-client): adjust to hyper client
* deal with hyper client not using a type-parameter anymore * fix incorrect documentation link (use '_' instead of '-') Fixes #47
1 parent 6f2149b commit 191e822

4 files changed

Lines changed: 8 additions & 14 deletions

File tree

src/mako/Cargo.toml.mako

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<%! from util import (estr, hash_comment, library_to_crate_name) %>\
1+
<%! from util import (estr, hash_comment, library_to_crate_name, to_extern_crate_name) %>\
22
<%namespace name="util" file="lib/util.mako"/>\
33
<%block filter="hash_comment">\
44
<%util:gen_info source="${self.uri}" />\
@@ -13,7 +13,7 @@ repository = "${util.github_source_root_url()}"
1313
% if documentationLink is not UNDEFINED and documentationLink:
1414
homepage = "${documentationLink}"
1515
% endif
16-
documentation = "${cargo.doc_base_url}/${util.crate_name()}"
16+
documentation = "${cargo.doc_base_url}/${to_extern_crate_name(util.crate_name())}"
1717
license = "${copyright.license_abbrev}"
1818
keywords = ["${name[:20]}", ${", ".join(estr(cargo.keywords))}]
1919

src/mako/api/lib.rs.mako

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ use std::cell::RefCell;
4646
use std::borrow::BorrowMut;
4747
use std::default::Default;
4848
use std::collections::BTreeMap;
49-
use std::marker::PhantomData;
5049
use serde::json;
5150
use std::io;
5251
use std::fs;
@@ -79,8 +78,6 @@ pub struct ${hub_type}${ht_params} {
7978
client: RefCell<C>,
8079
auth: RefCell<A>,
8180
_user_agent: String,
82-
83-
_m: PhantomData<NC>
8481
}
8582

8683
impl<'a, ${', '.join(HUB_TYPE_PARAMETERS)}> Hub for ${hub_type}${ht_params} {}
@@ -93,7 +90,6 @@ impl<'a, ${', '.join(HUB_TYPE_PARAMETERS)}> ${hub_type}${ht_params}
9390
client: RefCell::new(client),
9491
auth: RefCell::new(authenticator),
9592
_user_agent: "${default_user_agent}".to_string(),
96-
_m: PhantomData
9793
}
9894
}
9995

src/mako/lib/util.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
'%': 1,
110110
}
111111

112-
HUB_TYPE_PARAMETERS = ('C', 'NC', 'A')
112+
HUB_TYPE_PARAMETERS = ('C', 'A')
113113

114114
# ==============================================================================
115115
## @name Filters
@@ -827,8 +827,7 @@ def hub_type_params_s():
827827

828828
# return a list of where statements to server as bounds for the hub.
829829
def hub_type_bounds():
830-
return ['NC: hyper::net::NetworkConnector',
831-
'C: BorrowMut<hyper::Client<NC>>',
830+
return ['C: BorrowMut<hyper::Client>',
832831
'A: oauth2::GetToken']
833832

834833
# Returns True if this API has particular authentication scopes to choose from

src/rust/api/cmn.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,8 @@ impl HeaderFormat for RangeResponseHeader {
481481
}
482482

483483
/// A utility type to perform a resumable upload from start to end.
484-
pub struct ResumableUploadHelper<'a, NC: 'a, A: 'a> {
485-
pub client: &'a mut hyper::client::Client<NC>,
484+
pub struct ResumableUploadHelper<'a, A: 'a> {
485+
pub client: &'a mut hyper::client::Client,
486486
pub delegate: &'a mut Delegate,
487487
pub start_at: Option<u64>,
488488
pub auth: &'a mut A,
@@ -494,9 +494,8 @@ pub struct ResumableUploadHelper<'a, NC: 'a, A: 'a> {
494494
pub content_length: u64
495495
}
496496

497-
impl<'a, NC, A> ResumableUploadHelper<'a, NC, A>
498-
where NC: hyper::net::NetworkConnector,
499-
A: oauth2::GetToken {
497+
impl<'a, A> ResumableUploadHelper<'a, A>
498+
where A: oauth2::GetToken {
500499

501500
fn query_transfer_status(&mut self) -> std::result::Result<u64, hyper::HttpResult<hyper::client::Response>> {
502501
loop {

0 commit comments

Comments
 (0)