Fix failure to write to keychain when signing in or failing to sign in (#4031)

Max Brunsfeld created

Release Notes:

- Fixed an error where Zed would not save credentials to the keychain
after signing in.

Change summary

crates/client/src/client.rs        | 7 ++-----
crates/live_kit_client/src/prod.rs | 1 +
crates/util/src/util.rs            | 1 +
3 files changed, 4 insertions(+), 5 deletions(-)

Detailed changes

crates/client/src/client.rs 🔗

@@ -1371,10 +1371,7 @@ fn read_credentials_from_keychain(cx: &AsyncAppContext) -> Option<Credentials> {
     })
 }
 
-async fn write_credentials_to_keychain(
-    credentials: Credentials,
-    cx: &AsyncAppContext,
-) -> Result<()> {
+fn write_credentials_to_keychain(credentials: Credentials, cx: &AsyncAppContext) -> Result<()> {
     cx.update(move |cx| {
         cx.write_credentials(
             &ZED_SERVER_URL,
@@ -1384,7 +1381,7 @@ async fn write_credentials_to_keychain(
     })?
 }
 
-async fn delete_credentials_from_keychain(cx: &AsyncAppContext) -> Result<()> {
+fn delete_credentials_from_keychain(cx: &AsyncAppContext) -> Result<()> {
     cx.update(move |cx| cx.delete_credentials(&ZED_SERVER_URL))?
 }
 

crates/live_kit_client/src/prod.rs 🔗

@@ -868,6 +868,7 @@ impl Drop for RemoteAudioTrack {
         // the crash in the `livekit.multicast` thread.
         //
         // unsafe { CFRelease(self.native_track.0) }
+        let _ = self.native_track;
     }
 }
 

crates/util/src/util.rs 🔗

@@ -244,6 +244,7 @@ where
     }
 }
 
+#[must_use]
 pub struct LogErrorFuture<F>(F, log::Level, core::panic::Location<'static>);
 
 impl<F, T, E> Future for LogErrorFuture<F>