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
This commit is contained in:
Marshall Bowers
2025-03-20 17:56:27 +00:00
committed by GitHub
parent f9f5126d2c
commit 27ebedf517
+3 -3
View File
@@ -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.