Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/authentication_manager.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::prelude::*;
use tokio::sync::Mutex;
use std::sync::Mutex;

#[async_trait]
pub trait ServiceAccount: Send {
Expand All @@ -20,7 +20,7 @@ impl AuthenticationManager {
///
/// Token can be used in the request authorization header in format "Bearer {token}"
pub async fn get_token(&self, scopes: &[&str]) -> Result<Token, Error> {
let mut sa = self.service_account.lock().await;
let mut sa = self.service_account.lock().unwrap();
let mut token = sa.get_token(scopes);

if token.is_none() || token.clone().unwrap().has_expired() {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub use types::Token;

use hyper::Client;
use hyper_rustls::HttpsConnector;
use tokio::sync::Mutex;
use std::sync::Mutex;

/// Initialize GCP authentication
///
Expand Down