File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -141,13 +141,14 @@ impl AppAccessToken {
141
141
client_id : impl Into < ClientId > ,
142
142
client_secret : impl Into < ClientSecret > ,
143
143
) -> AppAccessToken {
144
+ let expires_in = response. expires_in ( ) ;
144
145
AppAccessToken :: from_existing_unchecked (
145
146
response. access_token ,
146
147
response. refresh_token ,
147
148
client_id. into ( ) ,
148
149
client_secret,
149
150
response. scopes ,
150
- response . expires_in . map ( std :: time :: Duration :: from_secs ) ,
151
+ expires_in,
151
152
)
152
153
}
153
154
@@ -170,15 +171,7 @@ impl AppAccessToken {
170
171
. map_err ( AppAccessTokenError :: Request ) ?;
171
172
172
173
let response = crate :: id:: TwitchTokenResponse :: from_response ( & resp) ?;
173
- let expires_in = response. expires_in ( ) ;
174
- let app_access = AppAccessToken :: from_existing_unchecked (
175
- response. access_token ,
176
- response. refresh_token ,
177
- client_id,
178
- client_secret,
179
- response. scopes ,
180
- expires_in,
181
- ) ;
174
+ let app_access = AppAccessToken :: from_response ( response, client_id, client_secret) ;
182
175
183
176
Ok ( app_access)
184
177
}
You can’t perform that action at this time.
0 commit comments