Don't re-borrow a refcell while it is still in use (#269)

Despite multiple attempts on reusing the RefMut we get from the first
borrow as stored in `authenticator`, using it in the needed spot
seemed impossible despite the compiler trying to make suggestions.

Dropping `authenticator` and reborrowing is done for that reason,
fair enough.
This commit is contained in:
Sebastian Thiel
2021-04-12 10:06:50 +08:00
parent 5dc84bd041
commit 9e0133c1b4

View File

@@ -841,11 +841,12 @@ else {
dlg.store_upload_url(Some(url_str));
}
drop(authenticator);
client::ResumableUploadHelper {
client: &mut client.borrow_mut(),
delegate: dlg,
start_at: if upload_url_from_server { Some(0) } else { None },
auth: &mut *self.hub.auth.borrow_mut(),
auth: &mut *${auth_call},
user_agent: &self.hub._user_agent,
auth_header: format!("Bearer {}", token.as_str()),
url: url_str,