Add feature gates where required

This commit is contained in:
Lukas Winkler
2021-11-25 20:01:48 +01:00
parent 7e90b28cf2
commit c7793063e4

View File

@@ -260,10 +260,11 @@ impl ServiceAccountAuthenticator {
// TODO: Can those use statements be cleaned up?
/// Create an authenticator that uses a application default credentials.
/// ```
/// # #[cfg(any(feature = "hyper-rustls", feature = "hyper-tls"))]
/// # async fn foo() {
/// use yup_oauth2::ApplicationDefaultCredentialsAuthenticator;
/// use yup_oauth2::ApplicationDefaultCredentialsFlowOpts;
/// use yup_oauth2::authenticator::ApplicationDefaultCredentialsTypes;
/// # use yup_oauth2::ApplicationDefaultCredentialsAuthenticator;
/// # use yup_oauth2::ApplicationDefaultCredentialsFlowOpts;
/// # use yup_oauth2::authenticator::ApplicationDefaultCredentialsTypes;
///
/// let opts = ApplicationDefaultCredentialsFlowOpts::default();
/// let authenticator = match ApplicationDefaultCredentialsAuthenticator::builder(opts).await {
@@ -295,6 +296,11 @@ impl ApplicationDefaultCredentialsAuthenticator {
/// Use the builder pattern to deduce which model of authenticator should be used:
/// Service account one or GCE instance metadata kind
#[cfg(any(feature = "hyper-rustls", feature = "hyper-tls"))]
#[cfg_attr(
yup_oauth2_docsrs,
doc(cfg(any(feature = "hyper-rustls", feature = "hyper-tls")))
)]
pub async fn builder(
opts: ApplicationDefaultCredentialsFlowOpts,
) -> ApplicationDefaultCredentialsTypes<DefaultHyperClient> {