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 1
1
[package ]
2
2
name = " proton-api-rs"
3
3
authors = [" Leander Beernaert <lbb-dev@pm.me>" ]
4
- version = " 0.10.0 "
4
+ version = " 0.10.1 "
5
5
edition = " 2021"
6
6
license = " AGPL-3.0-only"
7
7
description = " Unofficial implemention of proton REST API in rust"
Original file line number Diff line number Diff line change @@ -41,15 +41,14 @@ impl RequestRepeater {
41
41
}
42
42
43
43
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 ( ) ;
45
45
match AuthRefreshRequest :: new (
46
46
borrow. uid . expose_secret ( ) ,
47
47
borrow. refresh_token . expose_secret ( ) ,
48
48
)
49
49
. execute_sync ( client, & DefaultRequestFactory { } )
50
50
{
51
51
Ok ( s) => {
52
- let mut borrow = self . user_auth . write ( ) ;
53
52
* borrow = UserAuth :: from_auth_refresh_response ( & s) ;
54
53
if let Some ( cb) = & self . on_auth_refreshed {
55
54
cb. on_auth_refreshed ( & borrow. uid , & borrow. access_token ) ;
@@ -62,7 +61,7 @@ impl RequestRepeater {
62
61
63
62
async fn refresh_auth_async < C : ClientAsync > ( & self , client : & C ) -> http:: Result < ( ) > {
64
63
// 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 ( ) } ;
66
65
match AuthRefreshRequest :: new (
67
66
user_auth. uid . expose_secret ( ) ,
68
67
user_auth. refresh_token . expose_secret ( ) ,
You can’t perform that action at this time.
0 commit comments