diff options
| author | pml68 <contact@pml68.me> | 2024-10-28 01:00:07 +0100 |
|---|---|---|
| committer | pml68 <contact@pml68.me> | 2024-10-28 01:00:12 +0100 |
| commit | 726e9023c4629d70410174ddbd1e6d43f7583fe5 (patch) | |
| tree | 569c3d25033f06ca708279565eafba76b0ca52ec /iced_builder/src/lib.rs | |
| parent | Merge pull request #3 from pml68/refactor/internal-restructuring (diff) | |
| download | iced-builder-726e9023c4629d70410174ddbd1e6d43f7583fe5.tar.gz | |
feat: implement very basic playground
fix: `is_dirty` was never checked for in the main update fn, allowing
unsaved work to easily be overwritten
Diffstat (limited to '')
| -rw-r--r-- | iced_builder/src/lib.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/iced_builder/src/lib.rs b/iced_builder/src/lib.rs index 14a044e..c6f3616 100644 --- a/iced_builder/src/lib.rs +++ b/iced_builder/src/lib.rs @@ -1,7 +1,7 @@ pub mod types; pub mod views; -use std::path::PathBuf; +use std::{io, path::PathBuf}; use iced::widget::{pane_grid, text_editor}; use types::{ @@ -12,7 +12,7 @@ use thiserror::Error; #[derive(Debug, Clone, Error)] pub enum Error { - #[error("an IO error accured: {0}")] + #[error("an I/O error accured: {0}")] IOError(String), #[error("a Serde error accured: {0}")] SerdeError(String), @@ -23,11 +23,11 @@ pub enum Error { #[error("the file dialog has been closed without selecting a valid option")] DialogClosed, #[error("{0}")] - String(String), + Other(String), } -impl From<std::io::Error> for Error { - fn from(value: std::io::Error) -> Self { +impl From<io::Error> for Error { + fn from(value: io::Error) -> Self { Self::IOError(value.to_string()) } } @@ -46,13 +46,13 @@ impl From<rust_format::Error> for Error { impl From<&'static str> for Error { fn from(value: &'static str) -> Self { - Self::String(value.to_owned()) + Self::Other(value.to_owned()) } } #[derive(Debug, Clone)] pub enum Message { - ToggleTheme, + ToggleDarkMode, CopyCode, SwitchPage(DesignerPage), EditorAction(text_editor::Action), |
