diff --git a/dart-api-dl/Cargo.toml b/dart-api-dl/Cargo.toml index 68fee02..9a0ce14 100644 --- a/dart-api-dl/Cargo.toml +++ b/dart-api-dl/Cargo.toml @@ -6,6 +6,7 @@ license = "Apache-2.0" [dependencies] dart-api-dl-sys = { package = "xayn-dart-api-dl-sys", version = "0.3.0" } +displaydoc = "0.2.3" once_cell = "1.9.0" static_assertions = "1.1.0" thiserror = "1.0.30" diff --git a/dart-api-dl/src/lifecycle.rs b/dart-api-dl/src/lifecycle.rs index c92a2b5..8af0e54 100644 --- a/dart-api-dl/src/lifecycle.rs +++ b/dart-api-dl/src/lifecycle.rs @@ -16,6 +16,7 @@ use std::ffi::c_void; use dart_api_dl_sys::Dart_InitializeApiDL; +use displaydoc::Display; use once_cell::sync::OnceCell; use thiserror::Error; @@ -98,14 +99,12 @@ impl DartRuntime { } /// Error representing that initialization failed. -#[derive(Debug, Clone, Error)] +#[derive(Debug, Clone, Error, Display)] #[non_exhaustive] pub enum InitializationFailed { /// Initialization was not yet done. - #[error("initialize_dart_api_dl was not yet called")] InitNotYetCalled, /// Initialization failed. - #[error("initializing dart api dl failed")] InitFailed, }