Skip to content

Commit 7b3c129

Browse files
authored
Merge pull request #9 from djc/std-mutex
Use std::sync::Mutex instead of an async variant
2 parents 6b00648 + a4e0274 commit 7b3c129

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/authentication_manager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::prelude::*;
2-
use tokio::sync::Mutex;
2+
use std::sync::Mutex;
33

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

2626
if token.is_none() || token.clone().unwrap().has_expired() {

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub use types::Token;
7272

7373
use hyper::Client;
7474
use hyper_rustls::HttpsConnector;
75-
use tokio::sync::Mutex;
75+
use std::sync::Mutex;
7676

7777
/// Initialize GCP authentication
7878
///

0 commit comments

Comments
 (0)