From 9095a6b04e1d7eb4e6f2241701b2eec29bf4ca5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Sinan=20A=C4=9Facan?= Date: Sun, 3 Mar 2024 20:18:08 +0100 Subject: [PATCH] Replace todo calls with error values in linux/platform (#8531) We currently use a mix of unimplemented methods with empty bodies and `todo!()` calls in linux/platform. `todo!()`s cause crashes in runtime with accidental key presses or clicks. To avoid this, this PR replaces `todo!()`s in linux/platform with error values. This helps when working on Zed itself, testing PRs etc. Release Notes: - N/A --- crates/gpui/src/platform/linux/platform.rs | 25 +++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/crates/gpui/src/platform/linux/platform.rs b/crates/gpui/src/platform/linux/platform.rs index 74a2bd301f2bc75905b3d102bd4f5b3ae98fd40b..feadee0ad6a7a8ce74c07fa011120673a5d35b65 100644 --- a/crates/gpui/src/platform/linux/platform.rs +++ b/crates/gpui/src/platform/linux/platform.rs @@ -321,8 +321,11 @@ impl Platform for LinuxPlatform { }) } + //todo!(linux) fn app_path(&self) -> Result { - unimplemented!() + Err(anyhow::Error::msg( + "Platform::app_path is not implemented yet", + )) } // todo(linux) @@ -332,8 +335,11 @@ impl Platform for LinuxPlatform { UtcOffset::UTC } + //todo!(linux) fn path_for_auxiliary_executable(&self, name: &str) -> Result { - unimplemented!() + Err(anyhow::Error::msg( + "Platform::path_for_auxiliary_executable is not implemented yet", + )) } // todo(linux) @@ -352,16 +358,25 @@ impl Platform for LinuxPlatform { None } + //todo!(linux) fn write_credentials(&self, url: &str, username: &str, password: &[u8]) -> Task> { - unimplemented!() + Task::Ready(Some(Err(anyhow::Error::msg( + "Platform::with_credentials is not implemented yet", + )))) } + //todo!(linux) fn read_credentials(&self, url: &str) -> Task)>>> { - unimplemented!() + Task::Ready(Some(Err(anyhow::Error::msg( + "Platform::read_credentials is not implemented yet", + )))) } + //todo!(linux) fn delete_credentials(&self, url: &str) -> Task> { - unimplemented!() + Task::Ready(Some(Err(anyhow::Error::msg( + "Platform::delete_credentials is not implemented yet", + )))) } fn window_appearance(&self) -> crate::WindowAppearance {