From 916aaa84e9a13093833d4bc06b605e7f9a5c99a6 Mon Sep 17 00:00:00 2001 From: Glenn Griffin Date: Fri, 8 Nov 2019 13:44:51 -0800 Subject: [PATCH] Authenticator.store no longer needs to be reference counted. --- src/authenticator.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/authenticator.rs b/src/authenticator.rs index 32f67ca..32cc348 100644 --- a/src/authenticator.rs +++ b/src/authenticator.rs @@ -29,7 +29,7 @@ struct AuthenticatorImpl< > { client: hyper::Client, inner: Arc, - store: Arc, + store: S, delegate: AD, } @@ -173,7 +173,7 @@ where C::Connector: 'static + Clone + Send, { let client = self.client.build_hyper_client(); - let store = Arc::new(self.store?); + let store = self.store?; let inner = Arc::new(self.token_getter.build_token_getter(client.clone())); Ok(AuthenticatorImpl { @@ -197,7 +197,7 @@ where T: AsRef + Sync, { let scope_key = hash_scopes(scopes); - let store = self.store.clone(); + let store = &self.store; let delegate = &self.delegate; let client = self.client.clone(); let appsecret = self.inner.application_secret(); @@ -213,7 +213,6 @@ where } // Implement refresh flow. let refresh_token = t.refresh_token.clone(); - let store = store.clone(); let rr = RefreshFlow::refresh_token( client.clone(), appsecret, @@ -254,7 +253,6 @@ where } } Ok(None) => { - let store = store.clone(); let t = gettoken.token(scopes).await?; if let Err(e) = store.set( scope_key,