From: Ian Jackson Date: Sat, 7 Aug 2021 15:19:07 +0000 (+0100) Subject: eyre: switch from anyhow to eyre X-Git-Tag: hippotat/1.0.0~290 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=9b24559912bb90f36a9b2eb81950a721d4de007e;p=hippotat.git eyre: switch from anyhow to eyre Signed-off-by: Ian Jackson --- diff --git a/Cargo.lock b/Cargo.lock index ef78702..32c7cbd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,12 +20,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "anyhow" -version = "1.0.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595d3cfa7a60d4555cb5067b99f07142a08ea778de5cf993f7b75c7d8fabc486" - [[package]] name = "atty" version = "0.2.14" @@ -174,6 +168,16 @@ dependencies = [ "syn", ] +[[package]] +name = "eyre" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "221239d1d5ea86bf5d6f91c9d6bc3646ffe471b08ff9b0f91c44f115ac969d2b" +dependencies = [ + "indenter", + "once_cell", +] + [[package]] name = "fehler" version = "1.0.0" @@ -377,12 +381,12 @@ dependencies = [ name = "hippotat" version = "0.0.0" dependencies = [ - "anyhow", "base64", "cervine", "configparser", "env_logger", "extend", + "eyre", "fehler", "futures", "hippotat-macros", @@ -488,6 +492,12 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + [[package]] name = "indexmap" version = "1.7.0" diff --git a/Cargo.toml b/Cargo.toml index 80f3614..a86ae56 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,6 @@ hippotat-macros = { path = "macros" } # versions specified here are mostly just guesses at what is needed # (or currently available): -anyhow = "1" # todo: switch to eyre, better display of errors base64 = "0.13" configparser = "2" env_logger = "0.9" @@ -47,6 +46,8 @@ void = "1" # Not in sid: extend = "1" # no deps not in sid +eyre = "0.6" # deps not in sid: +# indenter # no deps not in sid fehler = "1" # no deps (other than fehler-macros, obvs) lazy-regex = "2" # no deps not in sid cervine = "0.0" # no (non-dev)-deps not in sid diff --git a/src/prelude.rs b/src/prelude.rs index fd9fd83..277513a 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -23,7 +23,6 @@ pub use std::sync::Arc; pub use std::task::Poll; pub use std::time::{SystemTime, UNIX_EPOCH}; -pub use anyhow::{anyhow, Context}; pub use cervine::Cow as Cervine; pub use extend::ext; pub use fehler::{throw, throws}; @@ -44,6 +43,11 @@ pub use tokio::task; pub use tokio::time::{Duration, Instant}; pub use void::{self, Void, ResultVoidExt, ResultVoidErrExt}; +pub use eyre as anyhow; +pub use eyre::eyre as anyhow; +pub use eyre::WrapErr; +pub use eyre::Error as AE; + pub use crate::config::{self, InstanceConfig, u32Ext as _}; pub use crate::utils::*; pub use crate::queue::*; @@ -53,7 +57,6 @@ pub use crate::slip::*; pub type ReqNum = u64; -pub use anyhow::Error as AE; pub use ErrorKind as EK; pub use PacketError as PE;