diff --git a/iui/Cargo.toml b/iui/Cargo.toml index 1473a8df0..e273e67ee 100644 --- a/iui/Cargo.toml +++ b/iui/Cargo.toml @@ -38,7 +38,7 @@ maintenance = { status = "actively-developed" } [dependencies] bitflags = "1" libc = "0.2" -failure = "0.1" +thiserror = "1.0.20" ui-sys = { path = "../ui-sys", version = "0.2.1" } regex = "1" lazy_static = "1" diff --git a/iui/src/error.rs b/iui/src/error.rs index 3820d979d..cbd1489eb 100644 --- a/iui/src/error.rs +++ b/iui/src/error.rs @@ -1,22 +1,16 @@ //! Error types for this crate. /// The error type returned by functions in this crate which might fail. -#[derive(Fail, Debug)] +#[derive(thiserror::Error, Debug)] pub enum UIError { /// Signifies that the underlying library was unable to properly hook into the platform's GUI APIs. - #[fail( - display = "unable to initialize the underlying system bindings: {}", - error - )] + #[error("unable to initialize the underlying system bindings: {error}")] FailedInitError { error: String }, /// Signifies that an attempt was made to initialize a new instance of the underlying library while /// one already existed. - #[fail(display = "cannot initialize multiple instances of the libui toolkit")] + #[error("cannot initialize multiple instances of the libui toolkit")] MultipleInitError(), /// Signifies that an attempt was made to remove a tab from a tab group that was out of bounds. - #[fail( - display = "cannot remove index {} from tab group: there are only {} tabs in the group", - index, n - )] + #[error("cannot remove index {index} from tab group: there are only {n} tabs in the group")] TabGroupIndexOutOfBounds { index: i32, n: i32 }, } diff --git a/iui/src/lib.rs b/iui/src/lib.rs index f557aa161..97ffd6095 100644 --- a/iui/src/lib.rs +++ b/iui/src/lib.rs @@ -19,8 +19,7 @@ #[macro_use] extern crate bitflags; -#[macro_use] -extern crate failure; +extern crate thiserror; #[macro_use] extern crate lazy_static; extern crate libc;