Remove thiserror dependency

Uses derive_more instead
This commit is contained in:
Olivier Goffart 2025-01-06 13:12:55 +01:00
parent 58242676f6
commit a942ed0852
5 changed files with 17 additions and 19 deletions

View file

@ -25,5 +25,5 @@ i-slint-compiler = { workspace = true, features = ["default", "rust", "display-d
i-slint-core-macros = { workspace = true }
spin_on = { workspace = true }
thiserror = "1"
toml_edit = { workspace = true }
derive_more = { workspace = true, features = ["std", "error"] }

View file

@ -192,17 +192,17 @@ impl CompilerConfiguration {
}
/// Error returned by the `compile` function
#[derive(thiserror::Error, Debug)]
#[derive(derive_more::Error, derive_more::Display, Debug)]
#[non_exhaustive]
pub enum CompileError {
/// Cannot read environment variable CARGO_MANIFEST_DIR or OUT_DIR. The build script need to be run via cargo.
#[error("Cannot read environment variable CARGO_MANIFEST_DIR or OUT_DIR. The build script need to be run via cargo.")]
#[display("Cannot read environment variable CARGO_MANIFEST_DIR or OUT_DIR. The build script need to be run via cargo.")]
NotRunViaCargo,
/// Parse error. The error are printed in the stderr, and also are in the vector
#[error("{0:?}")]
CompileError(Vec<String>),
#[display("{_0:?}")]
CompileError(#[error(not(source))] Vec<String>),
/// Cannot write the generated file
#[error("Cannot write the generated file: {0}")]
#[display("Cannot write the generated file: {_0}")]
SaveError(std::io::Error),
}