From c1f50e1efa78ef7f35ed6f44828976fb7328d85b Mon Sep 17 00:00:00 2001 From: pml68 Date: Sun, 8 Jun 2025 02:04:09 +0200 Subject: feat: dialog improvements - "Unsaved changes" dialogs ask about saving the project - Trying to close the window also triggers an "unsaved changes" dialog when the editor is dirty. - Nicer API for dialogs (similar to what I do in `foghorn-rs/foghorn`) --- src/error.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/error.rs') diff --git a/src/error.rs b/src/error.rs index 9e1ee9d..c8405f4 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,3 +1,4 @@ +use std::borrow::Cow; use std::io; use std::sync::Arc; @@ -57,3 +58,9 @@ impl From for String { value.to_string() } } + +impl From for Cow<'static, str> { + fn from(value: Error) -> Self { + value.to_string().into() + } +} -- cgit v1.2.3