gpui: Don't panic on failing to set X11 cursor style (#21689)
One more panic (well, two) that should be a `log_err`. Release Notes: - N/A
This commit is contained in:
parent
4b93a5ca44
commit
ac07b9197a
2 changed files with 15 additions and 3 deletions
|
@ -206,6 +206,9 @@ pub trait ResultExt<E> {
|
|||
/// Assert that this result should never be an error in development or tests.
|
||||
fn debug_assert_ok(self, reason: &str) -> Self;
|
||||
fn warn_on_err(self) -> Option<Self::Ok>;
|
||||
fn anyhow(self) -> anyhow::Result<Self::Ok>
|
||||
where
|
||||
E: Into<anyhow::Error>;
|
||||
}
|
||||
|
||||
impl<T, E> ResultExt<E> for Result<T, E>
|
||||
|
@ -243,6 +246,13 @@ where
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn anyhow(self) -> anyhow::Result<T>
|
||||
where
|
||||
E: Into<anyhow::Error>,
|
||||
{
|
||||
self.map_err(Into::into)
|
||||
}
|
||||
}
|
||||
|
||||
fn log_error_with_caller<E>(caller: core::panic::Location<'_>, error: E, level: log::Level)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue