From 9e0133c1b4bc35d9a3e35ee587533ee0f5ee57c5 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 12 Apr 2021 10:06:50 +0800 Subject: [PATCH] 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. --- src/mako/api/lib/mbuild.mako | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mako/api/lib/mbuild.mako b/src/mako/api/lib/mbuild.mako index bd48ce45a2..887065b6df 100644 --- a/src/mako/api/lib/mbuild.mako +++ b/src/mako/api/lib/mbuild.mako @@ -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,