This repository was archived by the owner on Jul 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " proton-api-rs"
33authors = [" Leander Beernaert <lbb-dev@pm.me>" ]
4- version = " 0.10.0 "
4+ version = " 0.10.1 "
55edition = " 2021"
66license = " AGPL-3.0-only"
77description = " Unofficial implemention of proton REST API in rust"
Original file line number Diff line number Diff line change @@ -41,15 +41,14 @@ impl RequestRepeater {
4141 }
4242
4343 fn refresh_auth < C : ClientSync > ( & self , client : & C ) -> http:: Result < ( ) > {
44- let borrow = self . user_auth . read ( ) ;
44+ let mut borrow = self . user_auth . write ( ) ;
4545 match AuthRefreshRequest :: new (
4646 borrow. uid . expose_secret ( ) ,
4747 borrow. refresh_token . expose_secret ( ) ,
4848 )
4949 . execute_sync ( client, & DefaultRequestFactory { } )
5050 {
5151 Ok ( s) => {
52- let mut borrow = self . user_auth . write ( ) ;
5352 * borrow = UserAuth :: from_auth_refresh_response ( & s) ;
5453 if let Some ( cb) = & self . on_auth_refreshed {
5554 cb. on_auth_refreshed ( & borrow. uid , & borrow. access_token ) ;
@@ -62,7 +61,7 @@ impl RequestRepeater {
6261
6362 async fn refresh_auth_async < C : ClientAsync > ( & self , client : & C ) -> http:: Result < ( ) > {
6463 // Have to clone here due to async boundaries.
65- let user_auth = self . user_auth . read ( ) . clone ( ) ;
64+ let user_auth = { self . user_auth . read ( ) . clone ( ) } ;
6665 match AuthRefreshRequest :: new (
6766 user_auth. uid . expose_secret ( ) ,
6867 user_auth. refresh_token . expose_secret ( ) ,
You can’t perform that action at this time.
0 commit comments