diff --git a/src/mako/api/lib/lib.mako b/src/mako/api/lib/lib.mako index bbd657fc22..e6d6cf74af 100644 --- a/src/mako/api/lib/lib.mako +++ b/src/mako/api/lib/lib.mako @@ -256,7 +256,7 @@ use ${util.library_name()}::${hub_type}; // Get an ApplicationSecret instance by some means. It contains the `client_id` and // `client_secret`, among other things. % endif -let secret: ApplicationSecret = Default::default(); +let secret: oauth2::ApplicationSecret = Default::default(); % if comments: // Instantiate the authenticator. It will choose a suitable authentication flow for you, // unless you replace `None` with the desired Flow. @@ -268,7 +268,7 @@ let auth = yup_oauth2::InstalledFlowAuthenticator::builder( secret, yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect, ).build().await.unwrap(); -let mut hub = ${hub_type}::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth);\ +let mut hub = ${hub_type}::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);\ ## You will still have to set the filter for your comment type - either nothing, or rust_doc_comment ! diff --git a/src/mako/api/lib/mbuild.mako b/src/mako/api/lib/mbuild.mako index 89279d436a..260a1d99ab 100644 --- a/src/mako/api/lib/mbuild.mako +++ b/src/mako/api/lib/mbuild.mako @@ -371,7 +371,7 @@ let result = hub.${mangle_ident(resource)}().${mangle_ident(method)}(${required_ \ % endfor -${'.' + action_name | indent_by(13)}(${action_args}); +${'.' + action_name | indent_by(13)}(${action_args}).await; % if handle_result: match result { @@ -379,6 +379,7 @@ match result { // The Error enum provides details about what exactly happened. // You can also just use its `Debug`, `Display` or `Error` traits Error::HttpError(_) + |Error::Io(_) |Error::MissingAPIKey |Error::MissingToken(_) |Error::Cancelled diff --git a/src/mako/lib/util.py b/src/mako/lib/util.py index 083365570e..e84103962b 100644 --- a/src/mako/lib/util.py +++ b/src/mako/lib/util.py @@ -234,7 +234,7 @@ def markdown_rust_block(s): # wraps s into an invisible doc test function. def rust_test_fn_invisible(s): - return "# #[test] fn egal() {\n%s# }" % trailing_newline(s) + return "# async fn dox() {\n%s# }" % trailing_newline(s) # markdown comments def markdown_comment(s):