mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-07 03:56:42 +01:00
fix(docs): Example now uses hyper_rustls
It's already done by the CLI, but the docs still showed code that would only work in older hyper versions that still shipped with HTTPS. Fixes #169
This commit is contained in:
@@ -22,6 +22,9 @@ keywords = ["${name[:20]}", ${", ".join(estr(cargo.keywords))}]
|
||||
name = "${util.program_name()}"
|
||||
% endif
|
||||
|
||||
[dev-dependencies]
|
||||
hyper-rustls = "^0.6"
|
||||
|
||||
[dependencies]
|
||||
hyper = "^ 0.10"
|
||||
## Must match the one hyper uses, otherwise there are duplicate similarly named `Mime` structs
|
||||
|
||||
@@ -258,9 +258,9 @@ let secret: ApplicationSecret = Default::default();
|
||||
// retrieve them from storage.
|
||||
% endif
|
||||
let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate,
|
||||
hyper::Client::new(),
|
||||
hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())),
|
||||
<MemoryStorage as Default>::default(), None);
|
||||
let mut hub = ${hub_type}::new(hyper::Client::new(), auth);\
|
||||
let mut hub = ${hub_type}::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth);\
|
||||
</%def>
|
||||
|
||||
## You will still have to set the filter for your comment type - either nothing, or rust_doc_comment !
|
||||
|
||||
@@ -43,6 +43,7 @@ ${util.crate_version(cargo.build_version, revision)}\
|
||||
## Must be outside of a test function
|
||||
<%def name="test_prelude()">\
|
||||
extern crate hyper;
|
||||
extern crate hyper_rustls;
|
||||
extern crate yup_oauth2 as oauth2;
|
||||
extern crate ${util.to_extern_crate_name(self.crate_name())} as ${self.library_name()};
|
||||
</%def>
|
||||
|
||||
Reference in New Issue
Block a user