Skip to content

Commit f77a964

Browse files
committed
lint: fmt
1 parent 17811b1 commit f77a964

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

src/perms/oauth.rs

+22-5
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ use crate::{
66
};
77
use oauth2::{
88
basic::{BasicClient, BasicTokenType},
9-
AuthUrl, ClientId, ClientSecret, EmptyExtraTokenFields, StandardTokenResponse, TokenUrl, EndpointNotSet, EndpointSet, RequestTokenError,StandardErrorResponse, HttpClientError
9+
AuthUrl, ClientId, ClientSecret, EmptyExtraTokenFields, EndpointNotSet, EndpointSet,
10+
HttpClientError, RequestTokenError, StandardErrorResponse, StandardTokenResponse, TokenUrl,
1011
};
1112
use std::sync::{Arc, Mutex};
1213
use tokio::task::JoinHandle;
1314

1415
type Token = StandardTokenResponse<EmptyExtraTokenFields, BasicTokenType>;
1516

16-
17-
type MyOAuthClient = BasicClient<EndpointSet, EndpointNotSet, EndpointNotSet, EndpointNotSet, EndpointSet>;
17+
type MyOAuthClient =
18+
BasicClient<EndpointSet, EndpointNotSet, EndpointNotSet, EndpointNotSet, EndpointSet>;
1819

1920
/// Configuration for the OAuth2 client.
2021
#[derive(Debug, Clone, FromEnv)]
@@ -105,7 +106,15 @@ impl Authenticator {
105106
}
106107

107108
/// Requests a new authentication token and, if successful, sets it to as the token
108-
pub async fn authenticate(&self) -> Result<(), RequestTokenError<HttpClientError<reqwest::Error>, StandardErrorResponse<oauth2::basic::BasicErrorResponseType>>> {
109+
pub async fn authenticate(
110+
&self,
111+
) -> Result<
112+
(),
113+
RequestTokenError<
114+
HttpClientError<reqwest::Error>,
115+
StandardErrorResponse<oauth2::basic::BasicErrorResponseType>,
116+
>,
117+
> {
109118
let token = self.fetch_oauth_token().await?;
110119
self.set_token(token);
111120
Ok(())
@@ -127,7 +136,15 @@ impl Authenticator {
127136
}
128137

129138
/// Fetches an oauth token
130-
pub async fn fetch_oauth_token(&self) -> Result<Token, RequestTokenError<HttpClientError<reqwest::Error>, StandardErrorResponse<oauth2::basic::BasicErrorResponseType>>> {
139+
pub async fn fetch_oauth_token(
140+
&self,
141+
) -> Result<
142+
Token,
143+
RequestTokenError<
144+
HttpClientError<reqwest::Error>,
145+
StandardErrorResponse<oauth2::basic::BasicErrorResponseType>,
146+
>,
147+
> {
131148
let token_result = self
132149
.client
133150
.exchange_client_credentials()

0 commit comments

Comments
 (0)