From 27ebedf517b7990dfba9661a10fb0c4e95a73d40 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 20 Mar 2025 13:56:27 -0400 Subject: [PATCH] gpui: Make `App::get_name` return an `Option` (#27209) This PR makes `App::get_name` return an `Option` instead of panicking if the name is not set. We'll let the caller be responsible for dealing with the absence of a name. Release Notes: - N/A --- crates/gpui/src/app.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/gpui/src/app.rs b/crates/gpui/src/app.rs index 956cf3f43550083a964c68f3fa9835f3c98572c6..ab5a44392ea3b292748e79281eedcf09195e00ba 100644 --- a/crates/gpui/src/app.rs +++ b/crates/gpui/src/app.rs @@ -1590,10 +1590,10 @@ impl App { .insert(entity_id, window_invalidators); } - /// Get the name for this App. + /// Returns the name for this [`App`]. #[cfg(any(test, feature = "test-support", debug_assertions))] - pub fn get_name(&self) -> &'static str { - self.name.as_ref().unwrap() + pub fn get_name(&self) -> Option<&'static str> { + self.name } /// Returns `true` if the platform file picker supports selecting a mix of files and directories.